I need a string to split into its letters and save it in an array .I have no clue how to do this .Its possible in C++ but in C it seems like there is no way to do.
Or if there is a way to take an input string(a word )and save it as separate letters in an array will be ideal .I have used below mentioned code to get the input
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include<string.h>
int(){
char inputnumber;
printf( "Enter the number" );
// the word is like --> hellooo
scanf("%s", &inputnumber);
int i=0;
printf(inputnumber[i]);
}
Update: this is solved ,I did not declare a pointer to the char here ,that's the part which is missing then we can read the word letter by letter ,thanks all
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…