Is it safe to use malloc and it's derivatives with native C++ types? As sort of a learning experience I want to write my own stack class, first with integers, and I can't imagine how i'd write a...
Type: Posts; User: StapleGun
Is it safe to use malloc and it's derivatives with native C++ types? As sort of a learning experience I want to write my own stack class, first with integers, and I can't imagine how i'd write a...
Ah now I see what you're saying. But I'm not sure how I'd go about terminating that character? Haven't I declared nextChar int? As required by the function fgetc()?
Thanks, that was exactly the kind of information I was after regarding my file reading and string concatenation.
I fully understand that a pointer to a character is not a string. (How could I have...
For your first line, try:
while (ch == 'Y')
{
...
}
Alternatively you could use:
I've tried this for Warcraft III. If you modify any data in an online game (ie; Gold, Lumber, Hero Exp) you will be instantly disconnected. Not exactly sure how Wc3 detects it, but I think it has...
I've sort of got it working. Here's the code I have:
// Includes
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Prototypes
char *strConcat(char *str1, char *str2);
I've managed to load all of the text from a file into a single string. But I'm not sure if the way I've handled it is very safe, or very memory efficient. I'm still learning how all this stuff works....