1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-26 08:07:33 +02:00

Merge pull request #4513 from yashdodani/addScanfToC

[c/en] Added missing information about scanf in C
This commit is contained in:
Marcel Ribeiro Dantas
2022-11-20 03:45:14 -03:00
committed by GitHub

View File

@@ -101,6 +101,12 @@ int main (int argc, char** argv)
// %d is an integer, \n is a newline
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
///////////////////////////////////////
@@ -901,10 +907,11 @@ Node createLinkedList(int *vals, int len);
#endif /* End of the if precompiler directive. */
```
## 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)
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.
Another good resource is [Learn C The Hard Way](http://learncodethehardway.org/c/) (not free).