Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using GSM modem to send the text msg to the number who has sent the previous msg to the GSM modem (i.e, REPLY to sms) I am able to retrieve the phone no. and have stored the phone no. is a array. I have also created another array for storing the msg. However wen i read the phone no. array which i have set the limit to size 12 only also includes part of the elements of msg array also.... Later on i found out dat since both the arrays have taken sequential memory locations (i.e, phone array ends at memory location 05B and msg array starts from memory location 05C.
Hence to retify this prob I created a function as below...
C
lcd_putnstr(13,phone_num_buf); // to check the no. where the msg is being sent.

void lcd_putnstr(unsigned char len, char *str)
{
  unsigned char i = 0;
  while(*str != NULL && i < len)
  {
    lcd_write(*str);
    str++;
    i++;
  }
}


void putnstr(unsigned char len, char *str)
{
  unsigned char i = 0;
  while(*str != NULL && i < len)
  {
    putch(*str);
    str++;
    i++;
  }
}

putnstr(SIZE_OF_PH_NUM, (char* )phone_num);

#define SIZE_OF_PH_NUM 13


have declared the function where ever required but wen i compile it throws an error as...

Error [1098] conflicting declarations for variable and it points to putnstr function..


how this bug can be resolved???
Posted
Updated 30-Jun-10 20:54pm
v3

There is probably a library routine with the same name in a header file you use. Try renaming putnstr to something that is unlikely to conflict, like put_n_str_
 
Share this answer
 
"There is probably a library routine with the same name in a header file you use. Try renaming putnstr to something that is unlikely to conflict, like put_n_str_"


This also does not solve the issue... i have tried changing the function name but the same error occur..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900