Query regarding c and c++ programs

Asked by !ncredible on 2011-05-19

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

Language:
English Edit question
Status:
Solved
For:
Ubuntu gcc-defaults Edit question
Assignee:
No assignee Edit question
Solved by:
mycae
Solved:
2011-05-20
Last query:
2011-05-20
Last reply:
2011-05-19

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

delance (olivier-delance) said : #2

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

Best mycae (mycae) said : #3

These IDEs are front ends to a tool called "GDB", the GNU Debugger, which is the tool you want.
https://secure.wikimedia.org/wikipedia/en/wiki/GDB

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.

!ncredible (atul498) said : #4

Thanks mycae, that solved my question.

!ncredible (atul498) said : #5

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