mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Added missing information about scanf
This commit is contained in:
parent
2ed44955b5
commit
44e15f8004
@ -2,15 +2,15 @@
|
|||||||
language: C
|
language: C
|
||||||
filename: learnc.c
|
filename: learnc.c
|
||||||
contributors:
|
contributors:
|
||||||
- ["Adam Bard", "http://adambard.com/"]
|
- ["Adam Bard", "http://adambard.com/"]
|
||||||
- ["Árpád Goretity", "http://twitter.com/H2CO3_iOS"]
|
- ["Árpád Goretity", "http://twitter.com/H2CO3_iOS"]
|
||||||
- ["Jakub Trzebiatowski", "http://cbs.stgn.pl"]
|
- ["Jakub Trzebiatowski", "http://cbs.stgn.pl"]
|
||||||
- ["Marco Scannadinari", "https://marcoms.github.io"]
|
- ["Marco Scannadinari", "https://marcoms.github.io"]
|
||||||
- ["Zachary Ferguson", "https://github.io/zfergus2"]
|
- ["Zachary Ferguson", "https://github.io/zfergus2"]
|
||||||
- ["himanshu", "https://github.com/himanshu81494"]
|
- ["himanshu", "https://github.com/himanshu81494"]
|
||||||
- ["Joshua Li", "https://github.com/JoshuaRLi"]
|
- ["Joshua Li", "https://github.com/JoshuaRLi"]
|
||||||
- ["Dragos B. Chirila", "https://github.com/dchirila"]
|
- ["Dragos B. Chirila", "https://github.com/dchirila"]
|
||||||
- ["Heitor P. de Bittencourt", "https://github.com/heitorPB/"]
|
- ["Heitor P. de Bittencourt", "https://github.com/heitorPB/"]
|
||||||
---
|
---
|
||||||
|
|
||||||
Ah, C. Still **the** language of modern high-performance computing.
|
Ah, C. Still **the** language of modern high-performance computing.
|
||||||
@ -101,6 +101,12 @@ int main (int argc, char** argv)
|
|||||||
// %d is an integer, \n is a newline
|
// %d is an integer, \n is a newline
|
||||||
printf("%d\n", 0); // => Prints 0
|
printf("%d\n", 0); // => Prints 0
|
||||||
|
|
||||||
|
// take input using scanf
|
||||||
|
// '&' is used to define the location
|
||||||
|
// where we want to store the input value
|
||||||
|
int input;
|
||||||
|
scanf("%d", &input);
|
||||||
|
|
||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
// Types
|
// Types
|
||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
@ -901,10 +907,11 @@ Node createLinkedList(int *vals, int len);
|
|||||||
#endif /* End of the if precompiler directive. */
|
#endif /* End of the if precompiler directive. */
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Further Reading
|
## Further Reading
|
||||||
|
|
||||||
Best to find yourself a copy of [K&R, aka "The C Programming Language"](https://en.wikipedia.org/wiki/The_C_Programming_Language)
|
Best to find yourself a copy of [K&R, aka "The C Programming Language"](https://en.wikipedia.org/wiki/The_C_Programming_Language)
|
||||||
It is *the* book about C, written by Dennis Ritchie, the creator of C, and Brian Kernighan. Be careful, though - it's ancient and it contains some
|
It is _the_ book about C, written by Dennis Ritchie, the creator of C, and Brian Kernighan. Be careful, though - it's ancient and it contains some
|
||||||
inaccuracies (well, ideas that are not considered good anymore) or now-changed practices.
|
inaccuracies (well, ideas that are not considered good anymore) or now-changed practices.
|
||||||
|
|
||||||
Another good resource is [Learn C The Hard Way](http://learncodethehardway.org/c/) (not free).
|
Another good resource is [Learn C The Hard Way](http://learncodethehardway.org/c/) (not free).
|
||||||
|
Loading…
Reference in New Issue
Block a user