Update c.html.markdown

This commit is contained in:
himanshu81494 2015-10-09 20:59:05 +05:30
parent c1c7a96378
commit c899b6605e

View File

@ -307,8 +307,9 @@ int main(void) {
exit(-1); exit(-1);
break; break;
} }
/*
// using "goto" using "goto" in C
*/
typedef enum { false, true } bool; typedef enum { false, true } bool;
// for C don't have bool as data type :( // for C don't have bool as data type :(
bool disaster = false; bool disaster = false;
@ -323,7 +324,10 @@ int main(void) {
} }
error : error :
printf("Error occured at i = %d & j = %d.\n", i, j); printf("Error occured at i = %d & j = %d.\n", i, j);
// this will print out "Error occured at i = 52 & j = 99." /*
https://ideone.com/GuPhd6
this will print out "Error occured at i = 52 & j = 99."
*/
/////////////////////////////////////// ///////////////////////////////////////
@ -491,13 +495,15 @@ char c[] = "This is a test.";
str_reverse(c); str_reverse(c);
printf("%s\n", c); // => ".tset a si sihT" 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 as we can return only one variable
to change values of more than one variables we use call by reference
*/
void swapTwoNumbers(int *a, int *b) void swapTwoNumbers(int *a, int *b)
{ {
int temp = *a; int temp = *a;
*a = *b; *a = *b;
*b = temp; *b = temp;
} }
/* /*
int first = 10; int first = 10;