Guest User

Untitled

a guest
Jan 28th, 2020
95
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. void print_sch(char * buff){
  6.     int len, ind = 1, br = 0, counter = 0;
  7.     string name, naps[ind];
  8.    
  9.     for( ; buff [br] != ';'; br++) name += buff[br];
  10.     len = name.length();
  11.     for(int i = br + 1; buff[i] != '\0'; i++) if(buff[i] == ';') ind++;
  12.     for(++br; buff[br] != '\0'; br++){
  13.         if(buff[br] == ';') counter++;
  14.         else naps[counter] += buff[br];
  15.     }
  16.  
  17.     cout << "hi";
  18. }
  19.  
  20. int main(){
  21.     char buff[] = "everyman;1111;2222";
  22.     print_sch(buff);
  23.     return 0;
  24. }
RAW Paste Data