strtok, descripcion y ejemplo
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 /* strtok example */ 00003 #include <stdio.h> 00004 #include <string.h> 00005 00006 int main () 00007 { 00008 char str[] ="- This, a sample string."; 00009 char * pch; 00010 printf ("Splitting string \"%s\" into tokens:\n",str); 00011 pch = strtok (str," ,.-"); 00012 printf ("str:%s\n",pch); 00013 while (pch != NULL) 00014 { 00015 printf ("%s\n",pch); 00016 pch = strtok (NULL, " ,.-"); 00017 } 00018 return 0; 00019 }
Generated on Mon Aug 22 2022 03:56:47 by
1.7.2