wtf????? strcpy(stckmain.topelem, -1); strcpy copies strings. It doesn't do anything else. What string do you think is kept at non-existent...
Sorting is easy, there are all sorts of ways to do it. Google "sort algorithm".
Well the code still does this so I'm not surprised it doesn't accept negative numbers:...
I would suggest using a printf or cout statement within a for loop. e.g. for (int i=0; i<4; i++) printf("%c ",status[i]);
On what line of code?
Here's a thought: why not initialise dpt to zero? i.e. char *dpt=0; Then what happens?
Must be the classD stuff then. Obviously I know nothing about memory corruption caused by writing to memory with an uninitialised pointer.
You have to set it equal to something. I don't know what you're trying to do, but at a guess you want to store some characters in memory, would...
How did you try to initialise dpt?
char * dpt; defines dpt as a pointer to a char, but you never initialise this pointer anywhere. So when you use it at fin >>dpt; this writes to...
"-o source.s" might do the trick. I don't know, I use Visual Studio. Alternatively if you build the program, start it in debug mode and put a...
Compile to assembly and you'll see exactly what is going on.
Also you don't automatically need to quote everything that you're replying to. This is a forum, not a newsgroup, and messages remain in the...
Replying to your own post makes the post look "answered" and you are really better off leaving it at "0 replies" - we go through the forum looking...
The previous point about checking the return value of malloc is absolutely correct. Much of programming is about handling error conditions...
I don't know how dreamincode works, but how to post code is outlined where you post a new thread: immediately below the title box there is the...
It's an example of how to use it. It sets the 2nd element of arr to 27. As you can see, there is no difference between the stack version and the...
What answers do you get and what answers do you expect? Do you get different answers if you add ".0" to the end of each integer in the expression?...
I meant the whole code for NullObject, and you should use code blocks to avoid smilies and to preserve formatting. Have you tried making the...
No, because long is also 4 bytes. If you don't want to use malloc (why not?) then you need to read your compiler documentation to find out how to...
Separate names with a comma.