Thread: Simple Assignment Help

  1. #1
    Registered User
    Join Date
    Oct 2013
    Posts
    6

    Simple Assignment Help

    I am a first year computer Science Major and need a quick answer to help me with my program. I have to make a program that uses three modules (controlmod, Calculationmod, and Printmod). We are not allowed to use global varriable and you must read the information (Test Marks) in Control Mod. How would i go about getting this values into my other functions. Thanks Alot

  2. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    4,509
    I'm assuming that by "modules", you mean "functions".

    Values can be passed to functions, and a value can be returned from a function. Using these concepts, you should be able to read a value in one function, return that value from that function, and pass that value to another function for further processing.

    Have you covered functions?

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,415
    Use parameters.
    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.

  4. #4
    Registered User sarvsav's Avatar
    Join Date
    Oct 2013
    Posts
    25
    Yes , passing argument is one of the best solution.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple Assignment, Can't Figure Out the Calculation
    By iamtazb in forum C Programming
    Replies: 7
    Last Post: 10-01-2012, 05:39 AM
  2. How can I make this simple assignment more eloquent ?
    By gordonfreeman in forum C Programming
    Replies: 9
    Last Post: 03-31-2012, 01:44 PM
  3. Simple C assignment, need help!
    By dallonhamilton in forum C Programming
    Replies: 4
    Last Post: 12-06-2010, 12:45 PM
  4. Simple help with an assignment
    By Anaesthetic in forum C++ Programming
    Replies: 4
    Last Post: 09-13-2010, 08:04 PM
  5. This one simple thing I cant do for my assignment need help
    By Rumproast23 in forum C++ Programming
    Replies: 9
    Last Post: 09-27-2006, 09:41 PM