Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to convert String to char
05-05-2014, 01:13 PM,
#1
How to convert String to char
Hi
I need get some string from serial port and change this to several char.
How can I do it?
Reply
05-05-2014, 02:44 PM, (This post was last modified: 05-05-2014, 02:45 PM by moreno.)
#2
RE: How to convert String to char
Hi

?????

In C any string is a collection of char, you need only indexing it.

char String[100];
int LenOfString;
char FirstChar, LastChar;

String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
LenOfString = strlen(String);
FirstChar = String[0];
LastChar = String[LenOfString-1];


Bye Bye, Moreno
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)