sushil
October 18, 2007, 5:04pm
1
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
pcanal
October 18, 2007, 5:10pm
2
What is the time of ‘id’?
Did you try checking the syntax using the compiler (by using ACLiC for example)?
Cheers,
Philippe
sushil
October 19, 2007, 12:38am
3
[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
brun
October 19, 2007, 5:22am
4
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
sushil
October 19, 2007, 10:01am
5
Hi,
I have attached my .C file. The id declared as “TString id”.
with best,
sush
Plot3000.C (10.1 KB)
pcanal
October 19, 2007, 3:03pm
6
Since id is a TString you can replace strcmp with using the operator ==.
if ( id == "15" )
.
To use strcmp you should do:
Cheers,
Philippe
sushil
October 19, 2007, 5:04pm
7
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