954,492 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

an if statment

if(strcmp(s.name, stdname)==0)
is this statment is correct? i am having an error while executing this statment.. i have givn its headerfile

mk.hashmie
Newbie Poster
10 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

The problem may be with s.name, try using a variable without the dot.

StephNicolaou
Posting Whiz in Training
204 posts since Nov 2007
Reputation Points: 77
Solved Threads: 18
 
if(strcmp(s.name, stdname)==0) is this statment is correct? i am having an error while executing this statment.. i have givn its headerfile


Depends on hows is defined.
Depends on how name in s is defined.
Depends on how stdname is defined.
Depends on what headers are included.
Depends on what the error is since there are hundreds of error messages possible.

As it is, the statement is syntactically correct.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 
i am having an error while executing this statment..


That said if you want us to look deeper into the problem you can post your code and describe what the error is

zeroliken
Veteran Poster
1,106 posts since Nov 2011
Reputation Points: 201
Solved Threads: 162
 

Are you trying to compare an element of a structure with a variable???
Post your entire code.

jumbowat
Light Poster
39 posts since Jan 2012
Reputation Points: -3
Solved Threads: 4
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You