Thread: new recruit plz help!

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    6

    new recruit plz help!

    // i want to go in to void myFuction and change the y to 10 and then its go back to 7 but
    some thing wrong that program dont go in void myFunction


    Code:
    #include <iostream>
    
    void myFunction (); // prototyp
    int x = 5, y = 7; // global variabler
    
    using namespace std;
    int main ()
    
    
    {
    
    
    cout << " Now i am in main: " << x << "\n";
    cout << " Now i am in main: " << y << "\n";
    
    void myFunction ();
    
    cout << " Now i am back in main: " << x << "\n";
    cout << " Now i am back in main: " << y << "\n";
    
    int z;
    cin >> z;
    return 0;
    
    
    }
    
    void myFunction ()
    
    {
    int y=10;
    
    cout << " Now i am in myFuction: " << x << "\n";
    cout << " Now i am in myFuction: " << y << "\n";
    
    }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > void myFunction ();
    This is a prototype

    This is a function call
    myFunction ();
    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.

  3. #3
    Registered User
    Join Date
    Nov 2010
    Posts
    6

    Smile

    its working thanks alot

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. project .... help plz plz plz
    By Hitchhik3R in forum C Programming
    Replies: 13
    Last Post: 10-24-2010, 02:07 PM
  2. can any1 plz make this assignment
    By jean in forum C Programming
    Replies: 17
    Last Post: 05-13-2009, 09:19 PM
  3. [Request] Need Help Plz
    By TylerD in forum Tech Board
    Replies: 4
    Last Post: 01-03-2009, 09:54 AM
  4. Anyone plz help me
    By Rose_Flowers in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 09-17-2003, 12:01 PM
  5. help plz plz
    By nsssn73 in forum C++ Programming
    Replies: 2
    Last Post: 06-03-2002, 08:44 AM