Strcmp error

hi ,
i am running a .C code in root with the following line:

if (!strcmp(id, “15”) || !strcmp(id,“0”)){

It gives me the following error.

“error: strcmp parameter mismatch param[0] C u Plot3000.C”

I am using root 5.16

Is something wrong with the line? could sombody suggest a solution.

with best,
sush

What is the time of ‘id’?
Did you try checking the syntax using the compiler (by using ACLiC for example)?

Cheers,
Philippe

[quote=“pcanal”]What is the time of ‘id’?
Did you try checking the syntax using the compiler (by using ACLiC for example)?

Cheers,
Philippe[/quote]

Hi,
thanks for mail.

   i did not understand "time of 'id'"?? could you please explain in little bit detail.?

thanks,
with best,
sush

This was a typo from Philippe. He meant “type” instead of “time”.
Could you show your declaration for the variable “id”?
Do you have something like
char id[20];

Rene

Hi,
I have attached my .C file. The id declared as “TString id”.

with best,
sush
Plot3000.C (10.1 KB)

Since id is a TString you can replace strcmp with using the operator ==.

if ( id == "15" ).
To use strcmp you should do:

Cheers,
Philippe

hi
thanks it works.

But without doing what you mentioned this script works at afs account , So it means there have been some changes in the new versions.

Anyway thanks for the solution.
with best,
sushil