CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2008
    Posts
    47

    using namespace std; causing declaration syntax error

    I am using Turbo C version 3.0, see the following code,
    when compiled, causes declaration syntax error


    #include<iostream.h>
    #include<conio.h>
    #include<fstream.h>
    using namespace std;
    int main()
    {
    //using namespace std;
    ofstream f;
    clrscr();
    f.open ("ittuz.txt");
    cout<<"Created";
    f<<"This is a file generated by c++ pgm \n ";
    f<<"by /n /t Ajmal thagha Muhammed";
    cout<<"Wrted to file";
    f.close();
    cout<<"closed";
    getch();
    return 0;
    }

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: using namespace std; causing declaration syntax error

    Turbo C++ 3.0 was released in 1991. Get rid of it, that compiler won't tell you anything about the right way to program modern C++. The language has evolved since then.

    Also, this is the "Managed C++" forum, which is actually yet another language, so you're in the wrong place regardless.

  3. #3
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: using namespace std; causing declaration syntax error

    I suggest using Visual Studio 2010 Express http://www.microsoft.com/express/Downloads/.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  4. #4
    Join Date
    Jan 2008
    Posts
    47

    Re: using namespace std; causing declaration syntax error

    Solved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured