| Subject | : | Newbie problem - String Class |
| Author | : | JGiacchi os2man4@yahoo.com |
| Date | : | 22 Sep, 2002 on 22:56 |
| I'm in a Comp Sci class at my high school and I'm trying to get a string to work. This is my program. My compiler is IBM Visualage 4.0 and the error i get is "MSG CPPC0063E: The text"{" is unexpected." Any help you could give me would be greatly appreciated. #include <iostream.h> void verse(string lanimal, string lsound) Build FIRST, ask questions later. |
| Subject | : | Re:Newbie problem - String Class |
| Author | : | JasonL fdt93@yahoo.com |
| Date | : | 23 Sep, 2002 on 19:55 |
| Correct me if I'm wrong, but I don't believe "string" is a valid data type in C / C++ Strings need to be declared in one of 2 ways: 1. An array of char 's: char lanimal[10]; This is assuming you did not create a user-defined type called "string" elsewhere in the code. I'm also not sure how using the wrong data type declaration would produce the error message you're getting. Hope this helps. |
| Subject | : | Re:Newbie problem - String Class |
| Author | : | JGiacchi os2man4@yahoo.com |
| Date | : | 24 Sep, 2002 on 05:07 |
| That did help thanks a lot.
Build FIRST, ask questions later. |