Thread: Input a .txt file with pointers?

  1. #1
    Registered User
    Join Date
    Nov 2016
    Posts
    1

    Input a .txt file with pointers?

    Ok so i have figured out the load function and print function of a .txt input file. I need help with a check function (to check if the values scanned in main are in the loaded .txt file). the .txt file has names, account numbers, and account values.
    my program looks vaguely like this (plz ignore all compile errors, this is not exact code):

    Code:
    int main (int argc,char** argv)
    {
    
    int load_file(char*,char**,int *, float *,int)
    void print_file(char**,int *,float *,int)
    
    printf("Enter a name? ")
    scanf(%s,name)
    
    printf(Enter account number )
    scanf(%d,act number)
    
    //i need to check if the name and number entered is in my .txt file!
    //function must use pointers!!! and look like
    
    int check(char**,int *, char *,int, int)
    
    return 0;
    }
    //can some make the check function for me??
    My load and print functions print the .txt file.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    It might help if it were a little less vague by having 5 variables that you intent to pass to check.

    And no, we don't just write whole functions for you - you need to make some effort.

    Your load_file and print_file functions have a similar interface - study them in detail.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Input on arrays and pointers
    By cjohnman in forum C Programming
    Replies: 2
    Last Post: 05-01-2008, 01:57 PM
  2. link lists, pointers, using input\output file
    By chood72 in forum C++ Programming
    Replies: 1
    Last Post: 10-30-2005, 05:21 PM
  3. Problem with File Input & Pointers
    By jenna in forum C++ Programming
    Replies: 9
    Last Post: 12-04-2004, 11:34 PM
  4. input with 2D array and pointers
    By pxleyes in forum C Programming
    Replies: 13
    Last Post: 03-26-2004, 08:06 AM
  5. Arrays of pointers (input)
    By tyskater in forum C Programming
    Replies: 10
    Last Post: 12-17-2003, 12:00 AM

Tags for this Thread