Author: Daniel Clausen
Date: 06:26:55 12/31/02
Go up one level in this thread
On December 31, 2002 at 09:13:15, Uri Blass wrote: >How do I get rid of this warning? > >C:\unzipped\movei257source\main.c(939): warning #181: argument is incompatible >with corresponding format string conversion > num_fields=sscanf(buffer,"level%s %s %s %s %s %s %s %s >%s",&str1,&str2,&str3,&str4,&str5,&str6, > >Is there something wrong with the following? > >int num_fields=0; >char >str1[10],str2[10],str3[10],str4[10],str5[10],str6[10],str7[10],str8[10],str9[10]; >num_fields=sscanf(buffer,"level%s %s %s %s %s %s %s %s >%s",&str1,&str2,&str3,&str4,&str5,&str6, > &str7,&str8,&str9); > >I use it to read the winboard command after level(can be not more than 9 even in >the extended level command). >There were no problems with it but for some reasons the intel compiler see >problems. Not sure that the compiler means this, but you can/should skip the &-signs in str1-str9. In C, if you have an array like 'char str1[10]', 'str1' is equal to '&str1[0]', so it's already an address. Adding an additional '&' does not hurt, but it does nothing and may generate a warning. HTH Sargon
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.