Advertisement

03.04.2004 at 11:01PM PST, ID: 20907944
[x]
Attachment Details

string comparison in c

Asked by iamnamja in C Programming Language

Tags: comparison, string, c, compare, interger

Hey guys, I have two strings in different structs that I need to compare.  

typedef struct Ops
{
  char oC[20];
  char s1[15];
  char s2[15];
  char t[15];
  struct Ops *next;
} op;

typedef struct v
{
  char vRe[15];
  int ls;
  int f;
  int m;
  struct virtReg *next;
}vr;

.......

 if(strcmp(vrCurr->vRe, opCurr->s1) == 0){
.........
 or i tried using
if(strstr(vrCurr->vRe, opCurr->s1) == 0){
......

Whichever..  I just need to compare the two strings to see if they are equal. I keep getting an error saying incompatable types in assignment. and if i try if(strcmp(*vrCurr->vRe, *opCurr->s1) == 0)....  I keep get an error that says that strcmp is making a pointer from an interger without a cast.  Start Free Trial
 
Loading Advertisement...
 
[+][-]03.04.2004 at 11:10PM PST, ID: 10520549

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.04.2004 at 11:12PM PST, ID: 10520556

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.05.2004 at 05:32AM PST, ID: 10522299

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.05.2004 at 05:56AM PST, ID: 10522512

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.05.2004 at 06:05AM PST, ID: 10522598

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.05.2004 at 01:28PM PST, ID: 10527035

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.05.2004 at 10:01PM PST, ID: 10529665

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: C Programming Language
Tags: comparison, string, c, compare, interger
Sign Up Now!
Solution Provided By: ankuratvb
Participating Experts: 6
Solution Grade: A
 
 
[+][-]03.07.2004 at 01:00PM PST, ID: 10536363

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.07.2004 at 06:11PM PST, ID: 10537642

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32