dimanche 12 février 2017

How to get only one character back out of a string in C?

Vote count: 0

int main(void) {
  char x[50];

  fgets( x, 50, stdin );
  printf( "%s", &(x[1]) );
} //  main

If I type Hello World in this program it will output ello World but I just want the letter e returned. How can I do that?

asked 14 secs ago

Let's block ads! (Why?)



How to get only one character back out of a string in C?

Aucun commentaire:

Enregistrer un commentaire