Click here to Skip to main content
14,359,163 members

C / C++ / MFC

 
Questionc++ MS Word Pin
Member 1238494426-Jan-19 6:03
memberMember 1238494426-Jan-19 6:03 
AnswerRe: c++ MS Word Pin
jeron126-Jan-19 7:30
memberjeron126-Jan-19 7:30 
GeneralRe: c++ MS Word Pin
Member 1238494428-Jan-19 3:48
memberMember 1238494428-Jan-19 3:48 
AnswerRe: c++ MS Word Pin
Stefan_Lang28-Jan-19 3:11
memberStefan_Lang28-Jan-19 3:11 
QuestionHow to print all source code what was running? Pin
Member 1308136924-Jan-19 17:35
memberMember 1308136924-Jan-19 17:35 
AnswerRe: How to print all source code what was running? Pin
Victor Nijegorodov24-Jan-19 21:49
memberVictor Nijegorodov24-Jan-19 21:49 
GeneralRe: How to print all source code what was running? Pin
Member 1308136924-Jan-19 22:54
memberMember 1308136924-Jan-19 22:54 
GeneralRe: How to print all source code what was running? Pin
HS_C_Student26-Jan-19 5:06
memberHS_C_Student26-Jan-19 5:06 
It's hard to understand your question. I think there are many better ways of solving the problem which might include restructuring the program, especially to make that section into smaller modules or to create your own debugging interface and pass parameters through it so you have a functional means of tracking program states. If you could tighten up input validation and narrow the scope of acceptable input it may help detect bugs.

The way you want to do it printing code is not even remotely a standard functionality or common practice so it is a very oversized foot you are trying to shoehorn into a small shoe and the result will likely be as comfortable.

If you want to pursue it anyway it's hard to imagine without knowing your code. You could set up a custom table of watch variables and or expressions and use the stringizing operator in a macro, similar to an assert() style.

#define record_str (a) (fprintf(debug, "%s : %s", #a, a))

#define record_int(a) (fprintf(debug, "%s : %s", #a, itoa(a)))

Combine it with __LINE__ and or FILE or TIME

C/C++ line number - Stack Overflow[^]

Hope this helps
GeneralRe: How to print all source code what was running? Pin
Member 1308136926-Jan-19 12:22
memberMember 1308136926-Jan-19 12:22 
AnswerRe: How to print all source code what was running? Pin
Richard MacCutchan24-Jan-19 23:12
protectorRichard MacCutchan24-Jan-19 23:12 
GeneralRe: How to print all source code what was running? Pin
Member 1308136925-Jan-19 5:24
memberMember 1308136925-Jan-19 5:24 
GeneralRe: How to print all source code what was running? Pin
Richard MacCutchan25-Jan-19 5:46
protectorRichard MacCutchan25-Jan-19 5:46 
GeneralRe: How to print all source code what was running? Pin
Stefan_Lang28-Jan-19 3:01
memberStefan_Lang28-Jan-19 3:01 
AnswerRe: How to print all source code what was running? Pin
Stefan_Lang25-Jan-19 4:29
memberStefan_Lang25-Jan-19 4:29 
GeneralRe: How to print all source code what was running? Pin
Member 1308136925-Jan-19 5:30
memberMember 1308136925-Jan-19 5:30 
GeneralRe: How to print all source code what was running? Pin
Stefan_Lang28-Jan-19 1:42
memberStefan_Lang28-Jan-19 1:42 
QuestionRe: How to print all source code what was running? Pin
David Crow25-Jan-19 5:44
memberDavid Crow25-Jan-19 5:44 
AnswerRe: How to print all source code what was running? Pin
k505425-Jan-19 7:31
memberk505425-Jan-19 7:31 
QuestionRe: How to print all source code what was running? Pin
David Crow25-Jan-19 7:46
memberDavid Crow25-Jan-19 7:46 
GeneralRe: How to print all source code what was running? Pin
Member 1308136925-Jan-19 14:51
memberMember 1308136925-Jan-19 14:51 
GeneralRe: How to print all source code what was running? Pin
Stefan_Lang28-Jan-19 1:52
memberStefan_Lang28-Jan-19 1:52 
AnswerRe: How to print all source code what was running? Pin
Member 1308136925-Jan-19 14:43
memberMember 1308136925-Jan-19 14:43 
AnswerRe: How to print all source code what was running? Pin
Randor 25-Jan-19 14:51
professional Randor 25-Jan-19 14:51 
GeneralRe: How to print all source code what was running? Pin
Member 1308136926-Jan-19 13:53
memberMember 1308136926-Jan-19 13:53 
GeneralRe: How to print all source code what was running? Pin
Randor 26-Jan-19 16:43
professional Randor 26-Jan-19 16:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.