• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

referencing

I don't know if there is any problem on the script, but I cannot compile it successfully.
---------------------------------------
int search(char &term)
{  if (term == "a")   <---- here is the problem.
   { ...... }
}


int ssearch(char *a)
{  if (a[5] == "1")    <--- here is the problem
      return 0;
   else return 1;
}
Then is it possible to use the function ssearch by:
int x = ssearch(*name);
where *name is pointing to the string which I want to check.

Thanks in advance.
0
snap
Asked:
snap
1 Solution
 
yonatCommented:
"a" is a 2 charcters array: {'a', '\0'}.
You should instead write:
if (term == 'a')

(single quote instead of double quote)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now