Computer Science Canada why does this give me an error? |
Author: | Genisis [ Sun Apr 23, 2006 1:35 am ] |
Post subject: | why does this give me an error? |
im trying to read one letter form a data file and it gives me the error at "alpha.read (char lettersguessed [x], 0, 25);" alpha= the datafile lettersguessed[x] = the array it ill be stored in 0=offset at which to start storing characters 25= maximum number of characters to read it will highlight "char" and the error type will be: "Syntax: unexpected symbol ignored" any help is aprrecaited thanks |
Author: | wtd [ Sun Apr 23, 2006 1:49 am ] |
Post subject: | |
You'll need to provide more context. Also, please use code tags. Just guessing, though, I'd say you are not really familiar with how to declare arrays. |
Author: | Genisis [ Sun Apr 23, 2006 1:57 am ] |
Post subject: | |
this is my program can you tell me why its not working like what i will need to add? |
Author: | HellblazerX [ Sun Apr 23, 2006 8:34 am ] | ||||
Post subject: | |||||
In your program, here:
the parameter is read (char [], int, int). Read will read the set of characters, and place in into the array. You should do it like this:
also, I wasn't sure what the char was supposed to be infront of lettersguessed. Were you trying to typecast, cuz if you were, you need (char). |