| re: function definition problem
"muser" <charlie12345@hotmail.com> wrote in message
news:f9a2a258.0307170914.2a146cce@posting.google.c om...[color=blue]
> The following error appears for the code I'm writing:
>
>
> error C2062: type 'int' unexpected
> C:\Program Files\Microsoft Visual
> Studio\MyProjects\Valid\Zenith124\Zenith.cpp(427) : error C2143:
> syntax error : missing ';' before '{'
> C:\Program Files\Microsoft Visual
> Studio\MyProjects\Valid\Zenith124\Zenith.cpp(427) : error C2447:
> missing function header (old-style formal list?)
> Error executing cl.exe.
>
> Zenith.obj - 3 error(s), 0 warning(s)
>
> All errors are related to the function definition, all structures are
> global declared and I tried decalring the variable check_digit with no
> success.
> Those that have responded in the past may already have seen this code
> and it would be a pleasure to hear from you again.
>
> struct sum {
> int calculation[5];
> int calc[6];
> int weight_factor[4];
> };
>
> union records {
> struct file1 rec;
> struct file2 rec1;
> struct file3 rec2;
> struct sum check;
> };
>
>
> int check_mod(union records, int check_digit);// function prototype.
>
>
>
>
> function defintion.
> int check_mod(files, int check_digit)[/color]
Your prototype does not match the definition. Did you mean:
int check_mod(union records, int check_digit)
?
Other than that, pretty much every line of your code seems flawed. Maybe
you want to look over it again and read out what you are doing with each
line to find out what you /want/ to do and what you are /actually/ doing.
hth
--
jb
(replace y with x if you want to reply by e-mail) |