Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Mixing strings in C++?
Name: Leo the 28C (by Sulfurik) Date: September 24, 2005 at 12:41:42 Pacific OS: Windows XP Home SP2 CPU/Ram: 2.8 GHz/448 MB
Comment:
Hello everyone! :-D OK, look at this:
[code] // Char array for holding map file (*.LMC) name char MAP_FILE[256];
// Query printf("Please type in the name of the map you want to use: ");
// Get gets(MAP_FILE);
// Change the title // ERROR HERE SetConsoleTitle("Mazzee - Prototype 3 - \"" + MAP_FILE + "\" Map"); [/code]
I get this error:
mazzee.cpp:175: error: invalid operands of types `const char[25]' and `char[256] ' to binary `operator+'
How do I fix it? MAP_FILE is a filename, so it has to be 256 letters long... Thanks! ;-)
Summary: How do you allocate more memory for a pointer in straight C? in C++ it would look like this: char *string; string = new char[11]; string = "hello world"; What I need to do is create and array of stri...
Summary: Hi As you know any string in C is an array of type "char". So lets assume you have the following: char str1[13] = "first second"; then you can start checking every characters of the string and copy th...
Summary: I posted down below, but I'll explain my problem a little better. I programming in C. Ok I have two arrays. One has a string in it and the other is empty. ie. char name1[10] = "Tom Petty"; char n...