No, it shouldn't be possible. However if you have memory corruption and if something overwrites ptr, then this could happen. Solution is to find...
Arrays are your friend, and malloc. int i=5; // or get this from the user struct stack1 *ptr=(struct stack1 *)malloc(sizeof(struct stack1)*i); //...
What is the value of asg? (Suggestion: put a printf in that displays the *actual* value. Do not answer this with what you *think* asg is.) By...
Something like this maybe? char *str="Hello world"; for (int i=0; str[i]; i++) { putchar(str[i]); putchar(' '); }
If there's really only one entry in the call stack then this means something has trashed the stack, probably a memory corruption of some sort....
Make sure that *EVERY* memory allocation is matched by a memory free, WITHOUT EXCEPTION. Then it won't leak.
sprintf(str,"The number-->%03d<<--rebmun ehT\n",27); RTFM!
Heck, or even char str[128]; sprintf(str,"The number is %d",n);
system() is pretty robust; what *exactly* doesn't work as you want if you use it? Specify something more exact than "the program may lose...
Does your program use signals?
I thought system did both of those.
I've no idea what you're talking about. What doesn't the code you posted do?
About printing the accounts, you don't really seem to have got a handle on this object-oriented thing. A bankacct object should represent just...
When you press New Topic to start a new thread, there's a bit of text that says Before proceeding, please make sure you are aware of the...
Yeah but you would only hit that if you ran multiple system() calls simultaneously via multithreading, not sequentially in a loop like for (i=0;...
Well if you can construct programatically commands like "d:\\ffmpeg -i ..." and they work from the command line (which would be the place to test...
Yes of course, that's the whole point of polymorphism.
Yep, I can, it's not hard. However I suspect this is in fact your homework, so I'm not going to do it for you. Have a go and see how far you...
You've been around here long enough to know by now: USE CODE BLOCKS WHEN POSTING CODE. It's REALLY not that hard. Read the posting guidelines if...
OK, you need to learn to read an error list, specifically you must start with the FIRST error not the LAST. The first error is this:...
Separate names with a comma.