Advertisement
ipsBruno

(C++) Simples Explode - Split

Oct 28th, 2012
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1.  /*
  2.  *  Copyright (c) 2012 [iPs]TeaM
  3.  *  Bruno da Silva (email@brunodasilva.com)
  4.  *  Cortar string e dividir estilo explode, split em C++
  5.  *
  6.  * www.brunodasilva.com
  7.  * www.ips-team.forumeiros.com
  8. */ 
  9.  
  10. char * parte;
  11. char string[] = "string|para|cortar"
  12.  
  13. parte = strtok( string , "|");
  14.  
  15. while ( parte != NULL ) {
  16.  
  17.      printf("%s cortada !!", parte);
  18.      parte = strtok(NULL, "|");
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement