We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello, I am a novice in C language and have been trying to find a method of reading/scanning input from GSM, then comparing it against a text (e.g OK or ERROR). Then if true set a break. I have tried scanf with no avail. I have also tried reading string which works but am unsure how to compare with my text.Has anyone any advice with what function would be useful? Any replies greatly appreciated. Andy
Warnings are; warning 96: 'gets' too few actual parameters warning 40: 'int' converted to near pointer get warning 40 twice.
I think the following will do what you want: char arr[5]; int result; gets(arr,4); //Note non-standard Keil gets() puts(arr); result=strcmp("Ok",arr); printf("Result=%d\n",result); There are many mistakes in the code you posted - you really need to work on your 'C' a bit with a good book. Stefan
Thankyou very much for taking the time to help me. I have several books on C I have got out of uni and have been using the PDF files. Do you recommend any books that are more Keil specifc? Thanks again
Take a look at: http://www.hitex.co.uk/c51primer/c51primer.html Stefan