Maker Pro
Maker Pro

Question in Char Separating

brian22

Jul 19, 2013
40
Joined
Jul 19, 2013
Messages
40
how to separate the content of a char ex. Hello World then i will store the World in byte? tnx
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
The world will not fit in a byte.

Bob
 

brian22

Jul 19, 2013
40
Joined
Jul 19, 2013
Messages
40
how about in char array?

i'm using a gsm lib and i want to separate the message in smsbuffer and store it in another byte/char array. tnx
 

gorgon

Jun 6, 2011
603
Joined
Jun 6, 2011
Messages
603
Normally an array of char is called a string. So you need to search for string manipulating functions.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
You apparently need to learn programming. I presume, from your use of "char" that you are using C. Find a C tutorial and study it.

Bob
 

brian22

Jul 19, 2013
40
Joined
Jul 19, 2013
Messages
40
i used arduino lib

Regexp.h

Code:
MatchState ms;
  char * str = smsbuffer;
  ms.Target (str);
  
  unsigned int index = 0;
  char buf [100];
  
  while (true)
  {
  char result = ms.Match ("(%a+)" "(%-?%d+)", index);
  
   if (result == REGEXP_MATCHED){
     for (int j = 0; j < ms.level; j++);
     gsm.WritePhoneNumber(result[j],(%-?%d+);
     index = ms.MatchStart + ms.MatchLength;
   }
   else 
     break;
  }
}

can you help how to correct this one.. tnx
 
Top