hi all
want to read a string of message from modem to pic16f877
scanf isnt working.i think i will have to use getch();
can anybody help me out for how to use this function. i want to recive the message "hello" which my gsm has transmitted to pic.
how will it come to know that the string has ended and what is the method to use this getch() function?
hi all
want to read a string of message from modem to pic16f877
scanf isnt working.i think i will have to use getch();
can anybody help me out for how to use this function. i want to recive the message "hello" which my gsm has transmitted to pic.
how will it come to know that the string has ended and what is the method to use this getch() function?
hi all
want to read a string of message from modem to pic16f877
scanf isnt working.i think i will have to use getch();
can anybody help me out for how to use this function. i want to recive the message "hello" which my gsm has transmitted to pic.
how will it come to know that the string has ended and what is the method to use this getch() function?
getch() does as defined - get one char, and you need an array to build your string 'hello,' which will be terminated with the nul char \0. You will need an array big enough to hold your string, plus one more bite for the nul, so to hold 'hello' you need myString[5] Don't forget that an array begins at 0, not 1, so
declare a byte as an index and loop through your array using something like:
while myString[index] not equal to '\0'
myString[index] = getch()
You should end up with something like: myString[0] = 'h', myString[1] = 'e' ... myString[5] =' \0'