int sscanf ( const char * s, const char * format, ...);
sscanf()
function Reads data from s and stores them according to parameter format into the locations given by the additional arguments, as if scanf was used, but reading from s instead of the standard input (stdin).const char * s
const char * format
...(additional arguments)
/* sscanf example */
#include <stdio.h>
int main ()
{
char sentence []="UMISHA is 42 years old";
char str [20];
int i;
sscanf (sentence,"%s %*s %d",str,&i);
printf ("%s -> %d\n",str,i);
return 0;
}
Output:
UMISHA -> 42
Name | Views | Likes |
---|---|---|
C++ ftell() Function | 254 | 0 |
C++ fseek() Function | 479 | 0 |
C++ rewind() Function | 383 | 0 |
C++ vsprintf() Function | 199 | 0 |
C++ fgetc() Function | 286 | 0 |
C++ vsscanf() Function | 197 | 0 |
C++ putc() Function | 316 | 0 |
C++ fputc() Function | 265 | 0 |
C++ fread() Function | 237 | 0 |
C++ vsnprintf() Function | 381 | 0 |
C++ getc() Funcion | 228 | 0 |
C++ |
245 | 0 |
C++ fwrite() Function | 259 | 0 |
C++ fsetpos() Function | 200 | 0 |
C++ getchar() function | 475 | 0 |
C++ tmpnam() Function | 206 | 0 |
C++ ungetc() Function | 229 | 0 |
C++ fgetpos() Function | 205 | 0 |
C++ setbuf() Function | 189 | 0 |
C++ fputs() Function | 238 | 0 |
C++ fclose() Function | 282 | 0 |
C++ Clearerr() Function | 231 | 0 |
C++ fgets() Function | 258 | 0 |
C++ Remove() Function | 252 | 0 |
Comments