Page 1 of 3 123 LastLast
Results 1 to 10 of 23
  1. #1

    Default C program special assignement - HELP ME!


    Mga bro, pwede ko patabang about sa C program class namo? Naa man guy gihatag nga assignment ang among maestra sa IT.

    Question niya kay:
    1. Unsa nang mga types of parameters?
    2. Ug unsa kuno ang gamit sa kanang return 0 unya void ang return type

    Mga bro, desparate kaayo ko maka kahibaw ani kay nang hadlok among maestra na mag quiz about ani..

    THANKS!

  2. #2
    1. the question is too broad. for me, what comes to mind is "pass by value" and "pass by reference" pointers.

    2. the return() function returns a value to the caller of the function. if you do a return 0, the value returned is 0. a return 0 has different meanings if a sub function is returning it or if the C program itself returns it. usually, if the program returns it (the return 0 line is in the main() block), then this simply indicates to the OS that the program executed without errors. if the return 0 is in a sub function, it can mean anything that the programmer wants.

    a void return type indicates that the function does not return any values. void in C means no values at all, not even 0.

  3. #3
    Elite Member
    Join Date
    Aug 2008
    Posts
    1,053
    Blog Entries
    1
    Quote Originally Posted by binarypill View Post
    2. the return() function returns a value to the caller of the function. i.
    perhaps what you mean "return" statement/keyword.

    You must return a value from a function based in your declaration (return type), unless you declared it, as "void".

    types of parameters:

    1. value type
    2. reference type (see pointers)

    function can be made without passing any parameters.

  4. #4
    marcdaven: don't have C programming books to refer to? Naa ra jud na tanan answer sa libro or search sa google.

    Basic jud kaayo na nga mga questions, it would require less analysis than making a C program with nested loops.
    -----------
    Kung wala ko masayop, basin mao ni pasabot sa inyo maestra:
    Function Parameters:
    1. Pass by Value
    2. Pass by reference

    Return types:
    main program
    refers to MS-DOS error codes
    MS-DOS extended errors
    DOS error codes

    functions
    (depends on what you are going to return)
    return (value)

  5. #5
    Elite Member
    Join Date
    Aug 2008
    Posts
    1,053
    Blog Entries
    1
    ChaosOrb, that isn't a guide for a proper returned value in common C/C++ (main) program. its a guide when you do some DOS programming, getting info after calling various interrupt, stored on various registers.

  6. #6
    Quote Originally Posted by marcdaven View Post
    Mga bro, pwede ko patabang about sa C program class namo? Naa man guy gihatag nga assignment ang among maestra sa IT.

    Question niya kay:
    1. Unsa nang mga types of parameters?
    2. Ug unsa kuno ang gamit sa kanang return 0 unya void ang return type

    Mga bro, desparate kaayo ko maka kahibaw ani kay nang hadlok among maestra na mag quiz about ani..

    THANKS!
    Let's keep it SIMPLE!!!!!
    Code:
    void func1(param[param.....])
    {
          ...
          .....
         return 0;
    }
    explaination:
    the void instructs the function that it will not return a data. Since the function is atempting to return a value and that is zero. That last instruction will be ignored. You will get error, it depends on the langauge or compiler.
    **C, maybe you get error
    **c#, may get warning
    **JAVA, may get error
    **PHP, no error
    **javascript, no error.
    that would be my expected outcome in my imagination.
    Last edited by dodie; 02-08-2010 at 01:05 PM.

  7. #7
    Code:
    void func1(param[param.....])
    {
          ...
          .....
         return 0;
    }
    -----------------------------------------------
    OT: sir, nag declare na ug void ang imong function.. no need naman siguro nga
    mo return paka ug 0 since void na gud na daan.

  8. #8
    i know... read the FIRST POST. and read my post carefully.
    Last edited by dodie; 02-08-2010 at 02:13 PM.

  9. #9
    special assignment for special student o special child like you heheheh

  10. #10
    @MarkCuering: yes

  11.    Advertisement

Page 1 of 3 123 LastLast

Similar Threads

 
  1. Can anyone help me with my assignments?
    By nitwit in forum General Discussions
    Replies: 32
    Last Post: 11-05-2022, 03:07 PM
  2. Help me uninstall my Deep freeze program.
    By Kibir_Tidibir in forum Computer Hardware
    Replies: 10
    Last Post: 09-05-2011, 02:57 PM
  3. Replies: 81
    Last Post: 02-19-2010, 02:03 PM
  4. Replies: 16
    Last Post: 10-12-2008, 02:10 AM
  5. Replies: 12
    Last Post: 04-17-2008, 04:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top