C++

C

Constant

Is there a way to "translate" a souce code or to know what that
particular line of cod is doing, it will help my beginer skill develop
faster.EX I have a sorce code that I have download so I would like to
know what each line of the cod is doing before I run it? Is there a
programe that does this translation or something to help me understand
the lines better?
Thanks for you effort and time in answering this questíon
 
J

Jeff Schwab

Constant said:
Is there a way to "translate" a souce code or to know what that
particular line of cod is doing, it will help my beginer skill develop
faster.EX I have a sorce code that I have download so I would like to
know what each line of the cod is doing before I run it? Is there a
programe that does this translation or something to help me understand
the lines better?

Not exactly. There is something called a "debugger" that will let you
step through the code one line at a time, show you the values of all
variables, etc.
 
W

Walter

Constant said:
Is there a way to "translate" a souce code or to know what that
particular line of cod is doing, it will help my beginer skill develop
faster.EX I have a sorce code that I have download so I would like to
know what each line of the cod is doing before I run it? Is there a
programe that does this translation or something to help me understand
the lines better?

With Digital Mars C++, compile the program with debug turned on:

dmc -c -g foo.cpp

Then run obj2asm on the resulting foo.obj:

obj2asm foo.obj

and the output will be the C++ source intermingled with the generated
assembler code. Each line of code will show what assembler it was compiled
to. The equivalent can be done with most compilers.

-Walter
www.digitalmars.com free C/C++/D compilers
 
C

Constant

Walter said:
With Digital Mars C++, compile the program with debug turned on:

dmc -c -g foo.cpp

Then run obj2asm on the resulting foo.obj:

obj2asm foo.obj

and the output will be the C++ source intermingled with the generated
assembler code. Each line of code will show what assembler it was compiled
to. The equivalent can be done with most compilers.

-Walter
www.digitalmars.com free C/C++/D compilers


Thanks walter is this working also the same way in windows enviroment??
 
C

Constant

I have complile the file that has iostream through stlport this way
dmc test -I\dm\stlport\stlport this line created an object caled
test.obj but when i try to run it with the command obj2asm gave me ...
bad command or file name, did i do something wrong?...thanks for your
time ...it is apprciated! I run this in win98
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,919
Members
47,458
Latest member
Chris#

Latest Threads

Top