Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

problem about pointer

Status
Not open for further replies.

hiramlee

Junior Member level 1
Junior Member level 1
Joined
May 15, 2012
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Chengdu,China
Activity points
1,408
int strcat(char *s, char *t){

while(*(s++)!='\0');
s--;
while(*(s++)=*(t++));

return 0;

}

Description Resource Path Location Type
Possible assignment in condition '*(s++)=*(t++)' strcat.c /strcat line 23 Semantic Error
Description Resource Path Location Type
suggest parentheses around assignment used as truth value [-Wparentheses] strcat.c /strcat line 23 C/C++ Problem
 

Code:
while(*(s++)=*(t++));

"=" is the assignment operator, you should use "==" for equality testing
 

ah! This function add the string t to the end of string s; so, here should be assignment operator "=", not "==".
Thanks all the way
 

In that case you can disregard the warning
Possible assignment in condition '*(s++)=*(t++)' strcat.c /strcat line 23 Semantic Error
because the compiler just tells you that it thinks you are using = instead of ==
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top