Hi,
try:
char *value;
value = attr.getNodeValue().transcode();
if (strcmp(value, "John") == 0) {
printf("Your name is John\n");
} else if (strcmp(value, "Tom") == 0) {
printf("Hello, Tom!\n");
}
...
delete[] value;
Since char * cannot be used in switch() expressions, as it says in the
errormessage.
<<error C2450: switch expression of type 'char *' is illegal
Integral expression required >>
Stefan
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 18, 2001 1:32 PM
Subject: getNodeValue().transcode()
Hi!
I'm trying to parse the value of a Node by using this piece
of code:
char *value;
value = attr.getNodeValue().transcode();
switch (value) {
case "John":
printf("Your name is John\n");
break;
case "Tom":
printf("Hello, Tom!\n");
break;
}
But I get this error:
<<error C2450: switch expression of type 'char *' is illegal
Integral expression required >>
Anybody could suggest an alternative to get the 'value'?
_______________________________________________________________________
Tu correo gratuito en HispaVista - http://www.hispavista.com/altacorreo/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]