I am trying to separate each character of a string with this code but i am getting a "Segmentation fault".
It would be great if could someone tell me what i am doing wrong.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char** argv)
{
int i;
char input[80];
printf("Give an arithmetic expression in Inverse Polish Notation: \n");
scanf("%s", input);
for (i=0; i<strlen(input); i++)
printf("%s",input[i]);
return 0;
}
I am running the code at a linux machine thats why there is no system("pause"); at the bottom.
Thanks for your time

New Topic/Question
Reply



MultiQuote




|