Re: [Dev-C++] newbie function_struct_array problem
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <wa...@wa...> - 2004-05-14 22:24:13
|
On 14 May 2004 at 15:31, Dane Ensign wrote: > Hi, > Dane here. Im having trouble getting my assignment program to compile. > There is something incorrect between the function prototype, function > call, and function headerline. But I cant figure it out. Please can > someone help me to understand where I am going wrong? 1. Don't use ".h" files in a C++ program. Change those to cstdlib and cstring. Assuming, of course, that you really want to use C strings. 2. Your prototype for CreateEmployee needs to be after you define what a "struct Emp" is so that you can put "struct Emp" in your parameter list. 3. Your parameter list needs a pointer to a "struct Emp" not just a "struct []". 4. You're not setting the employee id based on the subscript into the array. 5. You're setting the employee id to 0 for all employees. There are probably other things that I'm not seeing in a cursory glance. I made these mods and the code ran correctly. > > Thank you in advance for any help you can offer me. Im sorry if Im not > supposed to include my code. SHould I attach it next time? It would be really hard to determine what your problems were without the code to look at. :) Watson (the pencil neck) Davis |