mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-05-05 06:18:32 +00:00
Update c.html.markdown
This commit is contained in:
parent
c1c7a96378
commit
c899b6605e
@ -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,8 +495,10 @@ 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;
|
||||||
|
Loading…
Reference in New Issue
Block a user