Advertisement
Antosik

Untitled

Oct 15th, 2015
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.73 KB | None | 0 0
  1. void ParseRow(char RowIn[]){
  2.     int i = 0, k = 0;
  3.     bool flag = false;
  4.     char *pstr = RowIn;
  5.     char c_ = ' ', num[512] = { 0 }, osn[512] = { 0 }, *pNum = num, *pOsn = osn;
  6.     int nums = 0, base = 0;
  7.     while (*pstr){
  8.         c_ = *pstr;
  9.         if (isalnum(c_) && (c_ != ' ') && !flag){
  10.             *pNum++ = c_;
  11.         }
  12.         if (isalnum(c_) && (c_ != ' ') && flag){
  13.             *pOsn++ = c_;
  14.         }
  15.         if (c_ == '('){
  16.             strcpy(ColumnRow[k].Num, num);
  17.             printf("%s", num);
  18.             *pOsn = 0;
  19.             pOsn = osn;
  20.             flag = true;
  21.         }
  22.         if (c_ == ')'){
  23.             printf("(%s) \n", osn);
  24.             strcpy(ColumnRow[k].BaseString, osn);
  25.             ColumnRow[k].Base = atoi(ColumnRow[k].BaseString);
  26.             k++;
  27.             *pNum = 0;
  28.             pNum = num;
  29.             flag = false;
  30.         }
  31.         *pstr++;
  32.     }
  33.     printf("\n\nWTF!");
  34.     return;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement