Godders_2k, a char is one character, but what you have is a pointer.
You can allocate some memory and point szTemp to it then fill it up with your data.
Example off the top of my head:
Code:
char *szTemp;
int i=0;
szTemp=(char*)malloc(length of your string goes here); // Allocate some memory to store your string
strcpy(szTemp,"DwPSDsfAercecasdaaaofidsjafaplasdfafaasdfa"); // copy your string into memory
while(szTemp[i] != '\0') // Loop until until the end of string is found (NULL character is string terminator)
{
//Do something here. Current char can be gotten with: szTemp[i];
switch(szTemp[i++]) // This is where we find out what the character is. i++ advances location in memory to find the next character
{
case 'A':
{
printf("We found A at position %d in the string",i);
printf("Another way of printing our current character which is %c",szTemp[i]);
}
break;
case 'i':
{
printf("We found I at position %d in the string",i);
printf("Another way of printing our current character which is %c",szTemp[i]);
}
break;
}
}
free(szTemp); // Make sure to free up the memory you allocated when you are finished
That is just one way of doing it.