(with len being defined, no worries there), I get the 'undeclared identifier' compile error:
'new' undeclared (first use in this function)
Somehow, this scares me, since I think I used the operator correctly.
Edit: I hate how Google gives me no results before writing posts here and how it brings me exactly what I needed after I've posted the post.
I just used malloc and free instead:
1 2
char *numbuffer;
numbuffer = (char*) malloc(len+1); //len is defined beforehand
and in the function that calls the one which contains the snippet above:
1 2 3
char *strTrainno = getTrainno(buffer); //getTrainno is the name of the function mentioned above, buffer a parameter passed to the current fn
//do stuff with strTrainno
free(&strTrainno);
Dev C++ 4.9.9.2's standard compiler (first time working with this IDE, previous C++ coding has been done in Apple's XCode 2.x, on PPC macs), which, according to Dev C++'s offline help, is MingW32.
I have another question, though. What does one do when s/he is the only one coding and there is literally noone nearby (physically) to ask to look at the code? Because I don't want to litter any forum with requests which basically boil down to 'read my code and tell me where my typos are' (I've done so here already, and I'm sorry for it).