Query regarding c and c++ programs

Asked by !ncredible

i'v installed ubuntu 11.04 on ma lapi. i want to run c and c++ programs on it.

earlier, i was writing the programs in the text editor and the used to compile and run them in the terminal. but, there was a problem, whenever any error ocurrred in the program it was very difficult for me to trace the error like logical errors.

is there any way to run the program line by line and see its progress like which line it is going to execute next or which loop it is entering now.....like we do in the windows compiler using f5 key to run the program step by step.

usually,i have to switch to windows to run the program whenever i failed to trap the error in the llinux........is there any way to do the same in the linux......

also, i have downloaded the Eclipse.... can i run the c or c++ program in the Eclipse?? if yes, how? i dont even know the ABC of eclipse

Question information

English Edit question
Ubuntu gcc-defaults Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :

If you use an IDE like geany or something like that then you can do things like that

Revision history for this message
delance (olivier-delance) said :

"can i run the c or c++ program in the Eclipse?? " Yes , use CDT plug-in.

Revision history for this message
Best mycae (mycae) said :

These IDEs are front ends to a tool called "GDB", the GNU Debugger, which is the tool you want.

GDB allows for single line stepping, variable querying, breakpointing, conditional breakpointing etc. The IDEs will provide a nicer interface than the terminal based method however, but will still be powered by GDB behind the scenes.

Revision history for this message
!ncredible (atul498) said :

Thanks mycae, that solved my question.

Revision history for this message
!ncredible (atul498) said :

yeah! i've found the CDT plugin for eclipse and also downloaded it. now, when i open the eClipse Galileo it also shows me the C and C++ libraries. also i've found the GDB, it was alredy installed on ma system.

now, i am tryn to learn how to run the c programs on eclipse.....

thanks to all, for ua support