I am fairly new to C programming language. And I am getting stuck at finding the size of string the user inputs. A sample code is below:
char * input;
int main(){
printf("Enter the string : ");
scanf("%s\n", input);
int n = ( ) // this is where i put the size of input which i need at run time for my code to work
for (int i=0; i<n; i++){
// code here
// i create threads here
}
for (int i=0; i<n; i++){
// code here
// i join threads here
}
}
So, my problem is I can't find any answers at stack overflow which deals with the size of input above.
Any help will be appreciated.