Commit Graph

153 Commits

Author SHA1 Message Date
Jonathan
577b70a2e8
It's C, not c 2022-08-01 00:31:57 +02:00
krotera
6a0b4aee87
[c/en] clarity, errata, and grammar in array section (#4102)
* [c/en] clarity, errata, and grammar in array section

- [x] I solemnly swear that this is all original content of which I am the original author
- [x] Pull request title is prepended with `[language/lang-code]` (example `[python/fr-fr]` or `[java/en]`)
- [x] Pull request touches only one file (or a set of logically related files with similar changes made)
- [x] Content changes are aimed at *intermediate to experienced programmers* (this is a poor format for explaining fundamental programming concepts)
- [x] If you've changed any part of the YAML Frontmatter, make sure it is formatted according to [CONTRIBUTING.md](https://github.com/adambard/learnxinyminutes-docs/blob/master/CONTRIBUTING.markdown)
  - [x] Yes, I have double-checked quotes and field names!

* Overlooked type uniformity

* Improve 80 col alignment and clarify loop control var declaration

* Remove agrammatical comma

* Mention typedef in struct declaration
2022-01-04 00:44:49 +08:00
awschult002
99ddf8fec6
[c/en] mostly word clarification and extra descriptions (#4222)
* Adds extra clarity to enum value assignment.

The previous statement shows only 1 way to declare enums, and it happens
that they specify a starting value. I clarify that a starting value is
not necessary and that all enum value could contain user specified
values.

* Added clarity to `includes` section.

specified that angle brackets are for system libraries and not just
standard libs. I also added an example of relative paths in the local
include statements.

* Added more clarity for function prototyping and main return vals.

I cleaned up some formatting; then added some clarity to how function
prototyping works, as well as recommend techniques.

* Fixed the mention of character sizes. they are not always 1 byte

* Added clarity about floating point arithmetic.

The previous comments on floating points made it feel like there was
something broken with doing comparison and arithmetics with floating
point types. I added clarity about how floats are stored in memory and
why they seem to behave strangly when used in arithmetic expressions.

* reworded boolean stuff for better clarity on _Bool type in C99

* Adds not about binary assignment

* Added clarity for value roll over

* Added section on multiple return values.

C doesnt allow returning of multiple values, so i added a section on
returning multiple values through pointers.

* added section break for printing special characters

* fix typo

Co-authored-by: Andre Polykanine <ap@oire.me>

* fix typos

Co-authored-by: Andre Polykanine <ap@oire.me>

* fix markdown syntax

Co-authored-by: Andre Polykanine <ap@oire.me>

* fix markdown syntax

Co-authored-by: Andre Polykanine <ap@oire.me>

* fix markdown syntax

Co-authored-by: Andre Polykanine <ap@oire.me>

* reword with better english

Co-authored-by: Andre Polykanine <ap@oire.me>

* reword with better english

Co-authored-by: Andre Polykanine <ap@oire.me>

Co-authored-by: Andre Polykanine <ap@oire.me>
2021-08-24 21:57:49 +02:00
Lilian Besson
7616948a8e
Update c.html.markdown
Following reviews from @menelion
2021-01-31 13:56:45 +01:00
Lilian Besson
a86eb3f07e
Update c.html.markdown
Just add a few explanations where I thought details were missing
2021-01-30 15:25:22 +01:00
KoenigKrote
842b247b74 Requires -> Require 2020-02-21 18:46:28 -07:00
KoenigKrote
bf1fe71a83 Rephrase variable declaration comments 2020-02-21 18:41:29 -07:00
Heitor Pascoal de Bittencourt
da2caced22
[c/en] Fix link for Learn C the Hard Way book 2019-10-08 21:22:47 -03:00
Divay Prakash
4311e38667 Make description of static keyword stronger, closes #2848 2018-10-09 23:10:17 +05:30
Divay Prakash
70f896eed7 Fix printf, closes #2730 2018-09-13 00:18:37 +05:30
Dragos B. Chirila
5a78f9b3fc Add C99 comments, fix some typos and add clarifications in 'c.html.markdown' 2018-09-04 17:24:42 +02:00
Yoav
f1cc661f50
Update c.html.markdown 2018-03-25 18:04:53 +03:00
0x6a6f7368
81a637e1dd
Update c.html.markdown
How to get information on compiler flags.
2018-01-04 00:15:28 -05:00
0x6a6f7368
95d41ddf6c
Update c.html.markdown
Fixed and improved compiler flag default recommendations.
2018-01-04 00:06:44 -05:00
Jakob Rieck
8f990317b7 [c/en] Correct off-by-one error 2017-09-25 16:12:53 +02:00
Adam Bard
33d6dce8ba Update c.html.markdown
Fix presence of bool (Fixes #2854)
2017-09-12 22:43:55 -07:00
Adam Bard
a5c23e8af4 Update c.html.markdown
Note on macro hygiene. Fixes #2853
2017-09-12 22:42:18 -07:00
Adam Bard
a6e460618d Update c.html.markdown
Fixes #2846, #2849, #2851, #2852 (Thanks to @noncombatant)
2017-09-12 22:32:41 -07:00
HairyFotr
985d23a52b
Fix a bunch of typos 2017-08-23 10:14:39 +02:00
Aaroh Mankad
bea057020f [c/en-en] Make reference link in footer/summary link to Stack Overflow article (#2739)
* Make reference link in footer/summary link to Stack Overflow article

* remove name from list of contributors
2017-05-26 20:02:32 +00:00
Tyler Chong
98f213bc68 Update c.html.markdown (#2734) 2017-05-23 10:37:46 +02:00
Louis-Philippe Asselin
cc782a7cf2 fix further reading url (#2655)
Original link displays "This file has moved to process/coding-style.rst"
2017-02-12 19:33:22 +01:00
George Gognadze
b95bbd93f0 C/en typo, formatting fixes (#2537)
Space should be removed.
Before:
  // Access struct members with .
After:
  // Access struct members with.
C should be capitalized.
Before:
  // there is no Boolean type in c. We use ints instead.
After:
  // there is no Boolean type in C. We use ints instead.
Before:
Header files are an important part of c as they allow for the connection of c
After:
Header files are an important part of C as they allow for the connection of C
Before:
Header files are syntactically similar to c source files but reside in ".h"
After:
Header files are syntactically similar to C source files but reside in ".h"
Before:
files. They can be included in your c source file by using the precompiler
After:
files. They can be included in your C source file by using the precompiler
Before:
as the c file.
After:
as the C file.
Before:
/* should instead be put in a c file.                                       */
After:
/* should instead be put in a C file.                                       */
Before:
/* Beyond the above elements, other definitions should be left to a c source */
After:
/* Beyond the above elements, other definitions should be left to a C source */
Before:
/* a header file but instead put into separate headers or a c file.          */
After:
/* a header file but instead put into separate headers or a C file.          */
2016-10-31 00:35:31 +01:00
Subhrajyoti Sen
4dee8dd033 Update c.html.markdown (#2385) 2016-09-27 21:55:01 +02:00
Jakukyo Friel
c8fb84cc91 c: init array with string literals not introduced. (#2369)
* c: fix using pointer before introduced.

* c: init array with string literals not introduced.

To avoid using the concept pointer before it has been introduced,
previously it is changed to array.
But as @geoffliu pointed out,
array initialization using string literals is not introduced either.
So this commit uses neither pointer nor array.
Discussing `i++` and `++i` does not need to involve pointer or array.

* c: use `var = value` instead of `->`.

`->` is typically used for functions.
Thanks, @vendethiel.
2016-09-13 14:14:28 +02:00
Ryan
21c4be4779 Remove undefined behavior (#2332) 2016-08-17 21:25:32 +02:00
Michal Jurosz
02db6f2bfc Fix c - the first character of ILoveC is I not i (#2253) 2016-05-12 10:15:30 +02:00
Ryan Rauschenberg
7b78232897 issue 2205: Change variable 'size' to 'array_size' 2016-03-22 11:15:26 -04:00
Divay Prakash
f29bc25027 fixed 2016-03-12 13:39:06 +05:30
Divay Prakash
bb74c468c2 fixed whitespaces
removed whitespaces all over document
2016-03-03 11:41:52 +05:30
Jacob Ward
6981980ad5 [c/en] typos 2016-02-18 13:02:55 -07:00
George Gognadze
7560ea8199 typo
some type mistakes.
It is: syntaxtically
It should be: syntactically
It is: iLoveC
Better: ILoveC
It is: passed to ≈the function
It should be: passed to the function
It is: error
It should be: Error
2015-12-24 23:24:09 +04:00
Geoff Liu
6eeb1f962e Merge pull request #1872 from luehm/c_cases
[C/en] Added tidbit about fall-though in switch statements.
2015-12-18 17:22:50 -05:00
Alex Luehm
3b1940b9cc [C/en] Added tidbit about fall-though in switch statements.
Another pitfall, as not all languages have fall-through in switches.
2015-10-28 17:45:31 -05:00
Jody Leonard
b31fda3a8e Edit variable-length array example
The current example seems to be trying to set a size for a char buffer,
use fgets to populate that buffer, and then use strtoul to convert the
char content to an unsigned integer. However, this doesn't work as
intended (in fact, it results in printing "sizeof array = 0"), and so
adapt to a simpler fscanf example. Also remove some ambiguous language
in the example output.
2015-10-26 19:38:36 -04:00
Brendan Batliner
36fe7e1cce Added example of printIntArray in C 2015-10-15 16:38:42 -05:00
Brendan Batliner
2acf7822bd Update c.html.markdown
Added additional info on dynamically allocated arrays in C.
2015-10-15 16:34:53 -05:00
Zachary Ferguson
8417366a1b Cleaned up c file 2015-10-15 14:50:20 -04:00
Zachary Ferguson
65bb71f4bd Merge remote-tracking branch 'refs/remotes/adambard/master'
Conflicts:
	c.html.markdown
2015-10-15 14:48:59 -04:00
Levi Bostian
063c962254 Merge pull request #1512 from awalGarg/patch-2
[c/en] clarify common tripping point of newbies
2015-10-15 13:01:15 -05:00
Levi Bostian
c1982009c7 Merge pull request #1511 from awalGarg/patch-1
[c/en] clarify that args' names are not required in proto
2015-10-15 13:00:53 -05:00
ven
adc81a0bc5 Merge pull request #1480 from eltonvs/master
Translation fixes and extra information
2015-10-15 09:09:40 +02:00
Zachary Ferguson
27bb1a1e80 Removed separate code section
Removed the separate code section for header files
2015-10-14 21:59:42 -04:00
Elton Viana
328ceb1a94 Some extra information 2015-10-14 21:44:42 -03:00
Awal Garg
4599cd319f [c/en] clarify common tripping point of newbies
int foo () {
  printf("bar\n");
  int x; // this is not valid in C89+
}
2015-10-14 20:44:45 +05:30
Awal Garg
223c8140a0 clarify that args' names are not required in proto
with obligatory conventional warning
2015-10-14 20:41:36 +05:30
Zachary Ferguson
79ced08e09 Added Header title
+ Added a header file title
* Changed ```c to ```h
2015-10-13 11:05:20 -04:00
Levi Bostian
841f4c3d46 Merge pull request #1399 from himanshu81494/master
example function added for call by reference
2015-10-12 23:14:27 -05:00
Zachary Ferguson
e418849d76 [c/en] Added a section for header files.
Added a section for header files.
Included a discussion of what belongs in a header file and what does
not.
2015-10-09 11:52:08 -04:00
himanshu81494
c899b6605e Update c.html.markdown 2015-10-09 20:59:05 +05:30