Thread: Beginner's problem with C

  1. #1
    Registered User
    Join Date
    May 2009

    Beginner's problem with C


    I'm beginner to the C language and I'm trying to learn the language for an assignment that I have. But I'm running into trouble as I'm used to Java and OOP. What I need to do is to read a text file says something like:

    John Walmart BestBuy
    Mary Safeway Walmart

    Then what happens is the program I'm suppose to write should interpret John will visit Walmart first and then Bestbuy and Mary will visit Safeway, and then Walmart.

    Using pthreads.. so one for John and one for Mary, it will set up so that they don't visit the same store at the same time. So I'm guessing using Mutex lock on Walmart and Safeway first, then release Walmart when John is done so Mary can go to Walmart after...

    but I'm running clueless right now.. I'm hoping for some guidance on how I might be able to do this

  2. #2
    Registered User
    Join Date
    Sep 2006
    First thing, is to get clued into what you need to do, and you know, all the rest.

    Your homework assignment is your concern, and we won't do it for you.

    We will help you with any code problem you have, if possible. You must post up your code, and tell us specifically what the problem is, though.

    Life is too short to be fixing up assignments where the OP says "I don't know - it doesn't work", stuff. (OK, once in a great while, if the attempt looks really good).

    Pseudo code is also fine, but again, we won't take your pseudo code, and put it into actual code for you. Plumbers need to work with pipes, and programmers need to work with code.

    When you post back, it's helpful if you mention your specific compiler and/or IDE, as well.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  2. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  3. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  4. Beginner's Problem With First Funtion
    By Ohrange in forum C++ Programming
    Replies: 4
    Last Post: 04-19-2007, 06:59 PM
  5. A beginner's problem
    By NewToC in forum C Programming
    Replies: 5
    Last Post: 11-21-2002, 05:20 PM