Easy String position question...
Been out of the programming loop for awhile, and trying to ease myself back in. My first self appointed project has me stumped so thought I'd fire off a quick easy question for all the pros here on the board. :)
I have a string that i have a variable in, its 26 characters long. I want to read say the 10th character in. Is there a relatively easy way to find that? Here's what i have so far:
Code:
#include <stdio.h>
int main()
{
char test[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char single_test[] = " ";
clrscr();
/* Print test characters */
printf("Variable: %s\r\n", test);
/* Code here to go 10 characters out, and set the variable */
/* for ( i = 0; i < 10; ++i ) {
single_test = strsomething
} */
/* Print 10th character */
printf("The 10th character is: %s\r\n", single_test);
getch();
}
Any help would be appreciated.