Thread: C assignment help!

  1. #1
    Registered User
    Join Date
    Sep 2019
    Posts
    1

    C assignment help!

    Hi, so I got this assignment to extract names from the /etc/passwd file in Linux, using C.
    I'm supposed to use the strtok command to only get the: usename, first name (middle name) and last name.
    The easy part of struct and main is done, what I'm having trouble with is the strtok part where I have to extract the information and write part as you can see in the code.
    Any suggestions on how to solve it ?
    Attached Images Attached Images C assignment help!-skjermbilde-png 

  2. #2
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    699
    First of all, please don't post images! Post code in [ Code ] blocks. Please read the FAQ's at the top of the forum.

    Second, please don't ask us to code the solution for you! (Hint: FAQ again!)

    Third, read the manpage for strtok explanation, and Google for some examples on the net.

    Then show the attempt you have made by posting your code. Then we can comment on your code and make corrections and suggestions.
    Last edited by rstanley; 09-28-2019 at 09:23 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Assignment help
    By ADH94 in forum C Programming
    Replies: 33
    Last Post: 11-11-2012, 11:10 PM
  2. Assignment 2
    By jpjpjpjp in forum C Programming
    Replies: 4
    Last Post: 02-10-2010, 07:04 AM
  3. Replies: 3
    Last Post: 04-26-2009, 08:54 AM
  4. Assignment
    By cYou in forum C++ Programming
    Replies: 4
    Last Post: 06-12-2003, 07:57 AM

Tags for this Thread