Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Lv 56,951 points

ultimate reality1

Favorite Answers55%
Answers827
  • C language help with local variables and scanf?

    Hi, I was wondering this: if I ask a user to input 2 values in int main() as so...(not real code, just an inkling of what I want to do)

    int main()

    int x;

    int y;

    scanf ("%d","%d", &x, &y);

    and then pass those values to some function which error checks them like this

    int OTHER_FUNCTION (x, y);

    Now if I return back to main after error checking, will main still have x and y as the user input values or are they totally destroyed right after I exit main function to the OTHER_FUNCTION. If they are, then how could I possibly go about making sure they don't get destroyed after a function call (without using global variables)

    Thanks

    5 AnswersProgramming & Design1 decade ago