Rookie problem with C++ programming

Rookie problem with C++ programming

1
NewbieNewbie
1

    Jul 09, 2006#1

    I just purchased UltraEdit v12. I am also using a compiler by Borland. I am working through a :x beginner's book on programming. Anyways, I am trying to save a C++ template file as a .cpp file, but when I do, the icon that it saves it as is a text document. It is labeled .cpp and the format is file type is 'C', but the icon that shows up when I use Windows Explorer is a text icon. I hope this is making some sense. Is it maybe that my pc doesn't recognize the .cpp format? Any suggestions would be greatly appreciated. I can't go any farther in the book until I find a solution to this problem.
    This is the template that I was trying to save:

    // C++ code template
    #include <iostream.h>
    void main()
    {
    // code goes here!!
    }


    *also* the error that the command prompt gave me was "unable to open include file 'iostream.h' Error E2209"

    I hope this helps. Because I need some in a major way. Thanks a ton.

    6,682583
    Grand MasterGrand Master
    6,682583

      Jul 09, 2006#2

      Although your questions have nothing to do with UltraEdit and so you are definitively in the wrong forum, I will try to answer your questions. But next time use a Borland compiler related forum for such questions.

      First make sure your C++ file is really stored with the extension .cpp and not as .cpp.txt. Start Windows Explorer, go to menu Tools and click on Folder Options. Select View tab and uncheck "Hide file extensions for known file types" if it is checked. Then you will see always the real file extension of all files.

      Note: The file extension is by definition of Microsoft always only the part of the filename after last period. So for example "testfile.cpp.txt" has the file name "testfile.cpp" and the file extension "txt".

      Second which icon is shown for a file with a registered extension is stored in the registry and normally defined by the program which has registered the file extension. If you have specified to assign/register .cpp files to UltraEdit, it will be shown with the UltraEdit icon. Well, a C++ file is a text file.

      Last the Borland compiler error is a result of a missing makefile or project. You have to create a Borland project or a Borland makefile with all settings the Borland compiler and your program needs. As long as you have not created such a Borland project/makefile, the compiler does not know where the standard includes like iostream.h can be found. The path to the include files must be specified in the Borland project/makefile. See the Borland documentation for details.
      Best regards from an UC/UE/UES for Windows user from Austria