Thread: Necessary Files

  1. #1
    Main Poster
    Join Date
    Sep 2004
    Posts
    1

    Necessary Files

    When I try to open a new file to type C++ code, I find that I need to choose one of a few folders which contain other folders such as "Source Files". Can I just type, compile and run C++ code with just a new text file?

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    which compiler/OS are you using?
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    I'll take you down! polonyman's Avatar
    Join Date
    Sep 2004
    Posts
    50
    im not sure but i think ur tryin to say that u cant edit or create a program in the compiler (is that right?) u c most compilers need a source file that was created using notepad and saving it as a .cpp file. although u cant create u should be able to edit. if you cant, i suggest u get a new compiler. i reccomend dev c++, completely free. heres a link to it
    http://optusnet.dl.sourceforge.net/s...p4990setup.exe
    hope u enjoy!

  4. #4
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    Can I just type, compile and run C++ code with just a new text file?
    Yes. C++ source code is plain ASCII text. It's NOT a special format. (Don't use MS Word format, RTF, HTML, etc.)

    Some compilers (IDE's) will have an "open new project" option. Using this, rather than "open new text file" will help configure the compiler and linker.

    Your compiler may expect your source file to have a .cpp, or a .c extension, and it will expect to find the source file in a particular folder.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ressources files
    By mikahell in forum Windows Programming
    Replies: 4
    Last Post: 06-19-2006, 06:50 AM
  2. add source files to embedded VC 4.0
    By George2 in forum C++ Programming
    Replies: 4
    Last Post: 06-13-2006, 03:28 AM
  3. *.cpp and *.h files understanding
    By ElastoManiac in forum C++ Programming
    Replies: 4
    Last Post: 06-11-2006, 04:45 AM
  4. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 11:46 AM
  5. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 02:41 PM