Thread: Major Help! Calling all experts.

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    53

    Major Help! Calling all experts.

    I'm working on a huge project to challenge myself. It was compiling the other day and working great now that I've added a lot more it will not compile and run. Can some experts please over look these files and possibly one will see what I am not seeing. I've tried debugging in Microsoft Visual C++ 6, but I'm having trouble. Any help will be appreciated.

    The end result will be two txt files one as a log file keeping track of the programs results and the other is a data file keeping track of all entered data. Hopefully this group of talented individuals and I can piece it together.

    I've put all the C source files and .h header files in the zip that I attached. I'll check this thread tonight when I get home from working at home depot.
    Last edited by hern; 05-06-2004 at 09:31 AM.

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Your modules all do this.
    Code:
    #include "declare.h"
    #include "employee_data.h"
    The file "declare.h" is this.
    Code:
    #ifndef DECLARE_H
    #define DECLARE_H
    
    //Global Variables
    char filename[100];
    char message[300];
    int rc;
    
    //Function prototypes
    void print_menu();
    int create_log_file(char* filename);
    int print_log_message(char message[]);
    void get_current_time(char msge[]);
    EMPDATA* enter_data(int* num_array);
    char* convert_case(char* temp1);
    int format_SSN(char* temp1);
    int format_DOB(char* temp1);
    int write_file_data(data,num_array);
    
    #endif
    EMPDATA is defined in "employee_data.h". Either change the order of inclusion in all your modules, or have "declare.h" include "employee_data.h".

    In "employee_data.c", you need a prototype of 'get_data' before you call it in 'enter_data'.

    You have a typo in 'write_file_data'.
    Code:
    if(data_file==NULL_
    In 'get_data', there is no variable 'temp'.
    Code:
    scanf("%s",&temp1);
    And there is dangling code at the end of 'get_data'.
    Last edited by Dave_Sinkula; 05-06-2004 at 10:05 AM.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #3
    Registered User
    Join Date
    May 2004
    Posts
    127
    This is a good reason for keeping multiple versions of the source base. If you save the old working version when you make a change then you can easily perform regression tests if the changes cause you problems.

  4. #4
    Registered User
    Join Date
    Jun 2003
    Posts
    53
    Did it run after making those changes? I just got home...I plan on changing them tonight after I eat..

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Stack issues when calling a COM library
    By notnot in forum C Programming
    Replies: 3
    Last Post: 06-01-2009, 02:12 AM
  2. calling functions within functions
    By edd1986 in forum C Programming
    Replies: 3
    Last Post: 03-29-2005, 03:35 AM
  3. calling default instead of argument constructor, why?!
    By cppn00b in forum C++ Programming
    Replies: 6
    Last Post: 01-30-2005, 04:24 AM
  4. calling conventions
    By Micko in forum C Programming
    Replies: 2
    Last Post: 07-18-2004, 09:13 AM
  5. Question on function syntax and calling function
    By cbrman in forum C Programming
    Replies: 10
    Last Post: 10-05-2003, 05:32 PM