I'm learning C++ language now but i don't know which IDE should i use.Someone recommend DEC-C++ to me but it a little terrible debugging. I don't want use the bareGDB and how can i do.
thanks.:sad:

You can look here for a two good C++ free IDE's. They both are integrated with interactive and graphical debugger which should really go easy on you.

You can look here for a two good C++ free IDE's. They both are integrated with interactive and graphical debugger which should really go easy on you.

oh.the CodeBlocks looks well,thank you!
by the way,which ide you used?

Oh..I have used almost all the IDE's -- Visual Studio 6, Visual Studio .NET, Code::Blocks, Dev C++ etc.

Currently using Code::Blocks.

Oh..I have used almost all the IDE's -- Visual Studio 6, Visual Studio .NET, Code::Blocks, Dev C++ etc.

Currently using Code::Blocks.

hmmm...how can i built a "hello world" program with CodeBlocks..
i think the codes like this

#include <iostream>

using namespace std;

int main()
{
    cout<<"hello world!"<<endl;
    return 0;
}

but the build log like this :

Compiling: D:\Cplusplus\test.cpp
D:\Cplusplus\test.cpp:9:2: warning: no newline at end of file
Linking console executable: D:\Cplusplus\test.exe
Process terminated with status 0 (0 minutes, 1 seconds)
0 errors, 1 warnings

what's wrong whit the code and how can make it run...
by the way,what is Projects?

thanks,thanks a lot!

As for the warning message, all standard C++ compilers and so gcc requires you to have a newline at the end of the program according to the C++ standard:

2.1/1.2 "If a source file that is not empty does not end in a new-line
character, or ends in a new-line character immediately preceded by a backslash character, the behavior is undefined".

And as far as running the program is concerned, you have got three buttons at the top of your code blocks interface -- a gear (which compiles the code), an arrow( which runs the code) and a gear with a red arrow( which compiles and runs the code).

Best is that you use the function key F9 to compile as well as run the code.

The warning message disappeared but the three buttons still grey.
I create the code by "ctrl-n" and built it with "Build" menu->"compile current file" .

Okay, since I don't know how you created your project, I will give a brief walkthrough on how it is done.

  1. Go to File Menu -> Close Project. This should close all the windows or projects you must have opened and help us in starting a new project.
  2. After closing the project, you are directed to a welcome screen on which you will see a host of options.
  3. Click on "Create a new project"
  4. Select "Console Application". Make sure the language selected is C++.
  5. When you click on create button, a new window will pop up asking you for the path on which you want to save your project t o. Select an appropriate path, preferably create a new folder, with the name of your project and save your project in that folder.
  6. When you do so, you will return to the normal view and see a blank screen.
  7. On the left side of the screen, there will be a sub window called view manager which will show the file hierarchy with the name of your project. Open up the hierarchy by double clicking on it and then open the file main.cpp in the same manner.
  8. Start coding.

If you face problems even after this, let me know.

wow,it can be run...thank you very much!
in the default main page,like this

#include <iostream>

int main()
{
    std::cout << "Hello world!" << std::endl;
    return 0;
}

if i want change that,what should i do.

and please give me some suggest to learn that well...
^ ^ you are so kind、gentle..

I will assume from your post that this is your first attempt as C++ programming i.e. you are a beginner. To start get a good book and if you are at an University, you can get the book from the library or read whichever book you are referring.

Some basic tutorials (must read) :
http://www.cplusplus.com/doc/tutorial/
http://www.cprogramming.com/tutorial/lesson1.html
http://www.cs.wustl.edu/~schmidt/C++/

After you finish reading the above tutorials and get a bit of understanding, you can start off with Thinking in C++.

I will assume from your post that this is your first attempt as C++ programming i.e. you are a beginner. To start get a good book and if you are at an University, you can get the book from the library or read whichever book you are referring.

Some basic tutorials (must read) :
http://www.cplusplus.com/doc/tutorial/
http://www.cprogramming.com/tutorial/lesson1.html
http://www.cs.wustl.edu/~schmidt/C++/

After you finish reading the above tutorials and get a bit of understanding, you can start off with Thinking in C++.

they are helpful,thank you.

i have a question:
the compiler's default mode is not debug mode, so if i trying to debug i will got an error message. how can i change the compiler's mode to debug?

Go to Project -> Build Options and check the first entry at the bottom panel (produce debugging symbols -g). This should do it for the current project.

If you want to always compile in debug mode you can make the -g default by going in Build -> Compiler Options -> Produce debugging symbols -g.

And here's another classic example of why people should learn the language first instead of the tools.

All the miriad steps required to get something simple like Hello World (or any homework assignment) working using an IDE make it a non-trivial exercise and the student starts learning the tool instead of the language, defeating the very purpose he initially decided to use that tool for.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.