I nead help with scanf!!!

which letter shuld i change with ? in this code if input is for example 5+2, i nead some tipe which can read and symbols and numbers, i was searching on the internet but i couldnt find. I hope that there. Tnx!! sory for my bad english..

  scanf("%?, &a); 

I think this (Reads a number, then a character, then a number:
scanf("%d %c %d" , &num1 , &oper , &num2 );

Or you could do this (reads a string). Then you can tokenize it later:
char a[200];
scanf("%200[^\n]", a);

Last edited on
Topic archived. No new replies allowed.