about the .h file in c and C++ [modified]
-
dear guys, now my problem is I have use a lot of .h file to code , say, malloc.h stdlib.h and then I want to use some stl to code because it has some good method, so I include the string list, but then I complie then all, the debugger tells me the list variable is not declare it, and then I try to use , and found it is different from list.. anyone can tell me how to make my code run without such error?
modified on Monday, March 31, 2008 7:26 AM
-
dear guys, now my problem is I have use a lot of .h file to code , say, malloc.h stdlib.h and then I want to use some stl to code because it has some good method, so I include the string list, but then I complie then all, the debugger tells me the list variable is not declare it, and then I try to use , and found it is different from list.. anyone can tell me how to make my code run without such error?
modified on Monday, March 31, 2008 7:26 AM
-
dear guys, now my problem is I have use a lot of .h file to code , say, malloc.h stdlib.h and then I want to use some stl to code because it has some good method, so I include the string list, but then I complie then all, the debugger tells me the list variable is not declare it, and then I try to use , and found it is different from list.. anyone can tell me how to make my code run without such error?
modified on Monday, March 31, 2008 7:26 AM
You need a good
C++
book. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
dear guys, now my problem is I have use a lot of .h file to code , say, malloc.h stdlib.h and then I want to use some stl to code because it has some good method, so I include the string list, but then I complie then all, the debugger tells me the list variable is not declare it, and then I try to use , and found it is different from list.. anyone can tell me how to make my code run without such error?
modified on Monday, March 31, 2008 7:26 AM
wendyyue wrote:
the debugger tells me the list variable is not declare it,
Which means you are watching a variable in the debug window that has gone out of scope.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
wendyyue wrote:
the debugger tells me the list variable is not declare it,
Which means you are watching a variable in the debug window that has gone out of scope.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
wendyyue wrote:
you get my problem?
Apparently not. Your description is way too vague. Are you receiving a compiler, linker, or run-time error? Are you having trouble using the debugger? Does your program run, but fail to produce the correct result?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
wendyyue wrote:
you get my problem?
Apparently not. Your description is way too vague. Are you receiving a compiler, linker, or run-time error? Are you having trouble using the debugger? Does your program run, but fail to produce the correct result?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
sorry I did not clear my idea. I mean. originally, I use the pure c to code, but I want to use the list (from STL) to do some operation, so I insert some code which use the list varible list<<int >> a, and then I need to include the <<list>> file and <<algorithm>> file, right? But when I complie it, the debugger tells the a is not declared , but I have include the <<list>>, so I am not sure why, it is not runnable ?
-
sorry I did not clear my idea. I mean. originally, I use the pure c to code, but I want to use the list (from STL) to do some operation, so I insert some code which use the list varible list<<int >> a, and then I need to include the <<list>> file and <<algorithm>> file, right? But when I complie it, the debugger tells the a is not declared , but I have include the <<list>>, so I am not sure why, it is not runnable ?
-
wendyyue wrote:
can anyone help me?
Unlikely, given the lack of relevant information you've provided. If you want help, please explain your problem in detail and show only the code that relates to the problem. Be forewarned, posting an entire class or file is a sure-fire way to have your post flamed and/or ignored.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne