Update c.html.markdown

This commit is contained in:
himanshu81494 2015-10-08 14:44:10 +05:30
parent abd7444f9e
commit 9796759379

View File

@ -472,7 +472,22 @@ char c[] = "This is a test.";
str_reverse(c);
printf("%s\n", c); // => ".tset a si sihT"
*/
//as we can return return only one variable
//to change values of more than one variables we use call by reference
void swapTwoNumbers(int *a, int *b)
{
int temp = *a;
*a = *b;
*b = temp;
}
/*
int first = 10;
int second = 20;
printf("first: %d\nsecond: %d\n", first, second);
swapTwoNumbers(&first, &second);
printf("first: %d\nsecond: %d\n", first, second);
// values will be swapped
*/
// if referring to external variables outside function, must use extern keyword.
int i = 0;
void testFunc() {