Hi Friends, One simple doubt: const int a = 10; // global my_function() { const int b = 20; // local } Will both 'a' and 'b' be stored in data segment? If...
The way I understand Constants Only the compi.lier "Knows" about it. The end program doesn't. In this sence, Constants aren't even data. ... From: Arindam...
... Why do you care? What's more important is whether const means 'constant' or 'don't write'. It means the latter. So in the above fragments, you tell the...
... I suppose it depends on the compiler. K&R say that the const keyword may even be ignored by a compiler! This sort of thing is very implementation-dependent...
Hi, I'm having a class with lots of variables, and each one has a set get method. Its actually not very important but I hate having too much names in a class. ...
... Yes, in the sense that if you remove every instance of const (outside of string literals and the like obviously), the semantics of the program will not...
... Parameter names will 'shadow' globals in function methods. It's a matter of style, I prefer not to name parameters the same as a global that I need to use....
Can someone show me an example of how to use perror? For example, if((fp=fopen("file","wb"))==NULL perror() /* What goes into the char *string parameter */ ...
... It's used for any custom message that precedes the actual error message. You could put, for example, perror("YIKES! I was trying to open a file, but "); ...
... Typically you pass in a prefix, like the name of the program being run, and it prints out a string corresponding to the global variable errno (as returned...
... When you joined the group, you should have received the group welcome message. It contained information on how to find a compiler. In general, beginners...
... I have to disagree with this. IMO reliance on a debugger, especially by beginners, encourages sloppy thinking, poor understanding, and suck-it-and-see...
... I don't think Thomas was suggesting that a beginner rely on a debugger. But beginners should learn how to use a debugger early on, because it's a highly...
... I don't think using a debugger encourages sloppy thinking or poor understanding at all -- if anything, it helps increase one's understanding of the code....
Hello All, I want to ask about volatile types, is it possible to use the volatile var as a mutex or just an always fresh var? if yes , how i can do that? ...
... If the OS allows 32-bit programs to run in a 64-bit environment, then it is the OS' responsibility to handle that. The compiler may have something to do...
Hi everyone, Thank you for reading my post. I hope this is the right place where to post it. Here is my problem. I want to do some file uploading (sending...
lmhelp
lmbox@...
Oct 2, 2008 2:52 pm
68048
... Have a look at this web page: http://www.ddj.com/cpp/184403766 David...
... Assuming that the correct value of content length is being reported, variable i seems to be getting set to EOF too early. Now, getchar() returns EOF at the...
Hi, Thank you for your answer. So, I modified the code in the following way: ============================================================ int main() { int...
lmhelp
lmbox@...
Oct 2, 2008 5:54 pm
68051
Is this proper use of perror. FILE *fp; if ((fp=fopen("file","w"))==NULL) { perror(fp); clearerr(fp); exit(EXIT_FAILURE); } I am passing the pointer to perror...
... From: "~Rick" <Mowgli53@...> To: <c-prog@yahoogroups.com> Sent: Thursday, October 02, 2008 2:35 PM Subject: Re: [c-prog] perror ... Ok so the string...
Ok I will try this again, FILE *fp; if((fp=fopen("data","wb"))==NULL { perror("fopen"); clearerr("fopen"); exit(EXIT_FAILURE); } Is this the way to use perror...
... It can be whatever you want it to be. Traditionally, the name of the program is used, so you get something like this printed to the terminal window: ...
As you seem to have no errors reading stdin, perhaps the data being uploaded is corrupt or in the wrong format? Your HTML form should look like this: <form...
On Thu, Oct 2, 2008 at 1:17 AM, Jos Timanta Tarigan ... Hi This should be possible by using the scope resolution (::) operator to access the global variable. ...