Commit Graph

214 Commits (4b4762716c54aa809a2e02cf0e98d902de5f1296)

Author SHA1 Message Date
shadmantaqi 6750091708 add return 0; in example (#31008) 2018-12-17 10:33:30 -07:00
AKASH JAIN 4fc41ac133 Leaving Parts Blank in a for loop. (#30479) 2018-12-17 10:06:38 -07:00
Juan D Frias 6d97b7e795 Fixed formatting, expanded text and corrected code output (#30111) 2018-12-17 09:51:53 -07:00
Máté Szőnyi 0e92f98997 Added a note for the example (#29878)
When I started learning programming for a good amount of time I couldn't understand why did we start the loop from 0 to print out values of an array, because I didn't know the "arrays are indexed from 0" rule back then. I thought this could be helpful
2018-12-17 09:34:47 -07:00
Aathil Ahamed 4c69838a20 Added introduction to index.md (#28478)
I've add more and brief information about for loop and I briefly explained the function.
2018-12-17 09:21:24 -07:00
ishan-sriv d03e742a85 Add lines 45-57 (infinite loop) to the article (#27051) 2018-12-17 09:04:37 -07:00
kavyasreek9 19ef5250e6 Updated index.md (#26819)
* Updated index.md

Included description and examples of break and continue statements using for loop.

* fix: formatting
2018-12-17 08:45:37 -07:00
hariom Choudhary b9362d8674 Null Pointer explained (#25098)
* Null Pointer explained

* Grammar and formatting fixes
2018-12-15 21:56:35 -05:00
apurv22 1a3ae2106c Updated a sentence to be more meaningful. (#25036) 2018-12-15 01:51:03 -05:00
JOS PAUL SHAJAN b6ac02fdc6 Updated index.md (#24997)
* Updated index.md

Added base type and fixed minor errors.

* Grammar fixes
2018-12-15 01:41:21 -05:00
apurv22 738fa3553d Updated a sentence to be more meaningful. (#25033) 2018-12-15 01:22:52 -05:00
aniltirli be63fb4c3c line 277, 278, 282 comments enhanced (#24776) 2018-12-13 22:40:48 -05:00
Dikshant Bali 32a5816b61 Update index.md (#24544) 2018-12-11 19:17:39 -05:00
Dauli Pamale Alexis Ange 24d1276f9c Adding details to strcmp (#24491)
* Adding details to strcmp

* Reworded statement
2018-12-11 05:55:30 -05:00
Daniel ba11ff267a Corrected minimum int value in intro of "Data Types in C" in the C Guide (#24692)
* Corrected minimum int value in intro

As described in the "Standard Integers" section, at minimum and int can store values -32,768 to 32,767.  The negative value was incorrectly listed as -32,767 in the "Data Types in C" section.

* fix: typo
2018-12-11 13:53:35 +05:30
Anwesh Panda 58e61b2df6 Change that to than in Line 7 and add the ranges of int, long int and long long int. (#24366)
The ranges of int, long int and long long int are in line 23,31,43 respectively
2018-12-11 13:42:34 +05:30
apurv22 917f09aef2 Corrected grammar; changed 'are' to 'is' (#25030) 2018-12-11 13:32:23 +05:30
Petar Petkovic 1846972256 Loop through an array (#24420)
* Loop through an array

* Update index.md

* Removed extra spaces
2018-12-10 18:34:14 -05:00
blank10032 f760e90fc3 Added a section on why you would use macros (#24214) 2018-12-08 21:24:46 -05:00
kushan2018 4618195026 Update index.md , adding for loop examples (#24388)
* Update index.md

* Added code formatting to changes
2018-12-07 22:35:29 -05:00
ayush163 092a5a4ca8 Add the topic "Address Calculation" to the article (#24317) 2018-12-07 04:47:27 -05:00
kenbhatt bc65ccf919 My change is in line 18. (#23604)
Initialize----->start value
Condition---->stop value
Termination----->step value
2018-12-07 04:09:16 -05:00
LT 05eb597ca0 Fixed a simple typo. (#24169) 2018-12-07 03:59:12 -05:00
Rajesh Chittampally 14ea59d86d Added information about if statements, OR operator (#24356)
Added information about if statements, OR operator and fixed small typo issues.
2018-12-06 12:31:57 +05:30
wolfwhocodes 7d749d1117 Added a new string function called strncat (#23319)
Brief description and example of the strncat function was given.
2018-12-03 11:08:26 -07:00
kzellers 97f80c715c added example for incrementation (#23908) 2018-12-01 22:02:30 -05:00
wolfwhocodes 8848487622 Infinite for loop (#23252)
* Infinite for loop

A brief description of the infinite for loop was given along with an example.

* Added syntax highlighting
2018-12-01 21:52:31 -05:00
Emir 63144ea2ac Small contribution to switch statement (#23150) 2018-12-01 14:44:45 -07:00
msabitabrata 597ba0b9be Switch case with same code for multiple values (#23073)
* Switch case with same code for multiple values

Handle switch case when single piece of code runs for multiple values.

* removed invalid example numbering introduced in merge conflict resolution
2018-11-30 12:53:17 -07:00
Farai Mugaviri 15f51af38b Format and C syntax highlighting on code snippets (#25114) 2018-11-29 18:05:06 +05:30
Akash Kumar ab50b03c38 Add explanation about comments (#22944)
Add the text "Two backslash characters (//) are used to _comment_ the code, for better understandability. Anything after // on a line is ignored while compiling the program" to help new users understand commenting.
2018-11-28 19:34:05 -07:00
Anwesh Panda 1391626232 Add my changes to recursion . (#25155)
It describes the usage and importance of a base condition.
2018-11-28 18:24:28 +05:30
Krinjih daa880d822 Changed some examples (#22167)
Changed the layout of some examples, so they are recognized as C-Code
2018-11-26 04:54:57 -05:00
doug b bb34761dfd Fix guide -c -operators. Fixed formatting, added examples (#22717)
* working on fixing sizeof() operator

* working on fixing sizeof() operator

* Update index.md

* Update index.md
2018-11-25 11:42:43 -07:00
jagmeethanspal 9cea2d56a5 Added Special Operators in Macros (#22514)
One small fix and the explanation of Stringizing and Token Pasting Operators that can be used effectively in C macros.
2018-11-24 16:33:39 -08:00
Kirsten 60e2b8aa18 Update index.md (#26282)
Keep capitalization consistent in the article's title

Replaced "be able to know" with "become comfortable" to tighten up wording

Replaced "However, they" with "Furthermore, these guides"

Replaced "it" with "the C language"

Replaced "Mac" with "MacOS"
2018-11-23 22:09:17 +05:30
wolfwhocodes 1672a60482 Update on Names for variables (#23286)
Updated the rules for the first character of the variable name
2018-11-23 05:25:36 -05:00
Sudhakar Kumar 15be30e829 Fix spelling (#34383) 2018-11-22 16:17:54 -05:00
wolfwhocodes 281a6f4fb8 Associativity of operators (#23217)
When two or more operators of the same precedence occur in an expression, associativity determines the order in which they must be evaluated.
2018-11-22 04:10:27 -05:00
KevinMDuarte 5cd69f01c5 Added ternary operator (#22427)
Added ternary operator with some explanation and an example
2018-11-21 07:18:14 -08:00
Bearz314 97679fd4c2 Minor formatting change and added a note on == (#22378)
* Minor formatting change and added a note on ==

* Code blocks are now styled as C-language syntax.
* Added a note about the difference of `==` and `=` in the context of condition statements.

* change the second #6 to 7
2018-11-21 09:15:21 -06:00
rdfriesen 610c4303c1 typo fix (#21195) 2018-11-21 08:12:00 -05:00
Miftah Mizwar e9004f3e21 Update block of code to be highlighted as C (#22588) 2018-11-20 18:31:50 -05:00
Muralidharan Sekar 77246a193d Add the title "More information " to the article (#22288) 2018-11-20 07:40:29 -06:00
Krinjih c9a315f58a Added b to open modes (#22196)
* Added b to open modes

Added the binary mode to the different modes of opening a file

* Fixed formatting
2018-11-19 16:34:36 -05:00
Ilkay Tevfik Devran 251092a359 Example to Basic Socket Programming (#22179)
A link has been added for example to socket programming.
2018-11-19 16:32:41 -05:00
Krinjih 68e7028aab Added examples for logic operators (#22259)
* Added examples for logic operators

Added tables for examples for "and", "or" and "xor"

* fixed table formatting
2018-11-18 19:51:17 -07:00
Farai Mugaviri e73ffaf2fe Add void pointer to index.md (#22248)
* Update index.md

I added void pointers, which can be very useful in C programming, especially when dealing with unknown data types but had not been included.

* fixed formatting issues, removed attributions, moved placement to more appropriate location

* adjusted section header size
2018-11-18 19:23:19 -07:00
Muralidharan Sekar 7ad3dd4bd9 Add the text "Conditional operators" to the article (#22235)
* Add the text "Conditional operators" to the article

* fixed numbered list formatting
2018-11-18 19:19:25 -07:00
Krinjih e5a531682f Added a warning to the article (#22219)
* Added a warning to the article

Added a warning with an example, which can occur on older compilers.

* fix(guide): c for loop iterator misnomer

declaration not initialisation
2018-11-18 18:56:43 -07:00
Muralidharan Sekar 522ac6c139 Add the text "Nested Switch Case" to the article (#22165)
* Add the text "Nested Switch Case" to the article

* fix(guide): c nested switch typos
2018-11-18 18:30:20 -07:00
Shantanu Sharma 754384ebf9 Incomplete info while explaining while loop (#22265) 2018-11-18 07:14:27 -06:00
Saravanan Elumalai 427b5178f3 Added fclose to avoid core dump (#21957) 2018-11-17 15:44:01 -07:00
Saravanan Elumalai 3066b88340 Fixed code snippet bugs & added examples (#21925) 2018-11-17 12:33:20 -07:00
Chase 76f416935b Added modes for file handling in index.md (#21902)
Added different modes that can be used and their description under "The Real Deal" Section.
2018-11-17 11:14:58 -07:00
Bearz314 cf2d18322f Improved formatting and explanation on function prototype (#21832)
Minor corrections on formatting to increase legibility. Also improved the reasoning for using function prototypes.
2018-11-17 10:49:19 -07:00
kzellers 8bfe0c8ce6 added comments to example (#23656) 2018-11-17 16:17:48 +05:30
msabitabrata 603df3975e Proper indentation and readability (#23082)
Included one of the C code snippets inside ```c``` to improve readability
2018-11-17 00:15:56 -05:00
carlos fernandez 30b8d41421 fix 3 typos in #Explanation (#21809)
print() for printf()
Hello World! for Hello, World without the ! 
ans spaces between text           on the screen
2018-11-16 21:11:56 -07:00
Hemanath 29757050ef Fix typo in the explanation print() to printf() (#27881)
* Fix typo in the explanation print() to printf()

* Added basic syntax for declaring an array with all its elements as 0

* fix: removed &
2018-11-17 09:02:46 +05:30
vasubansal1033 7721e34a28 Add the text "* Arrays can store same data types only. A integer arra… (#21933)
* Add the text "* Arrays can store same data types only. A integer array will not be able to store chars in it." in review.

* Fixed grammar
2018-11-16 22:06:11 -05:00
Caleb Spradlin 5caa346be3 Fixed grammar errors and typos on lines 15, 18, 40 (#23238)
added commas, took away commas, and added a hyphen
2018-11-15 02:24:54 -05:00
Blaze2305 e7cc0c6d1a added ternary operation to conditional statements (#22773) 2018-11-15 11:17:04 +05:30
raghavbhartia ee8feba4b5 Elaborating struct comparison (#22429)
* Elaborating struct comparison

* fix: corrected path name issues
2018-11-14 14:52:10 -08:00
TrollzorFTW b8569bcc1d Typo on strcpy (#24848) 2018-11-14 21:18:46 +05:30
blankaex e2e460c19e Fixed formatting and typos (#24209) 2018-11-14 20:53:04 +05:30
katiepillar6 c90dfd2f81 Return 0 (#21561)
Added return 0 statement to the end of the code, to ensure a properly compiling program.
2018-11-14 08:14:44 -07:00
kichukiran97 ed3c729071 Fixed typo (#25889) 2018-11-14 18:01:18 +05:30
Prashant Chand 5a99e02a87 Add the syntax "For infinite loop " (#21382)
* Add the syntax "For infinite loop "

* Shifted additions around to be less confusing
2018-11-13 19:24:02 -07:00
Miftah Mizwar 9e5b352a86 Update wrong output of the example of code (#22530) 2018-11-13 21:07:32 -05:00
Miftah Mizwar 8eb754d4eb Update wrong output of the example of code (#22519)
* [x]  I have read [freeCodeCamp's contribution guidelines](https://github.com/freeCodeCamp/freeCodeCamp/blob/master/CONTRIBUTING.md).
* [x]  My pull request has a descriptive title (not a vague title like `Update index.md`)
* [x]  My pull request targets the `master` branch of freeCodeCamp.
* [x]  None of my changes are plagiarized from another source without proper attribution.
* [x]  My article does not contain shortened URLs or affiliate links.

If your pull request closes a GitHub issue, replace the XXXXX below with the issue number.

Closes #XXXXX
2018-11-13 01:36:14 -05:00
Vishal Kichloo 958c086a8e Added the disadvantage of the array. (#21379) 2018-11-12 15:33:42 -07:00
katiepillar6 640e1298b8 spaces and extra word (#21706)
Added spaces between sentences in first paragraph and removed an additional the in line 208
2018-11-11 00:25:37 -05:00
Brian dbc6c05166 Add example for ## A word on 'scope' (#21447) 2018-11-10 13:02:05 +00:00
Aditya Oberai 0363a40dcc Grammatical Edits (#22595) 2018-11-09 16:49:01 -05:00
Pawan Bangar 9372b49bb9 Add "Memory Allocation in Array" (#21234)
* Add "Memory Allocation in Array"

* fix: formatting, grammar and example

* fixed grammar, cleaned up table
2018-11-09 12:57:24 +05:30
Pawan Bangar 9e5d2baac1 ADD "Undefining Macro" (#21287)
* ADD "Undefining Macro"

we can undefine macro whenever we want in code by adding #undefine

* fix: markdown title format

* fix: minor grammar corrections

Capitalise first word and remove extra full stops
2018-11-08 19:22:35 +00:00
S.Hale 3920b7c4ce Corrected capitalization, corrected to American spellings and typos (#30685)
* Translate challenge subtitles and example challenge text to Spanish

* Corrected errors in syntax and punctuation

* Multiple corrections of it/s to its plus other grammar corrections

* Correction and added paragraph to CSS Flex article

* Corrected my own typo

* Corrected capitalization, American spellings and typos
2018-11-07 10:34:13 -05:00
arjundixit98 4f37069835 Adding lines and updation (#25081) 2018-11-06 19:35:57 +05:30
katiepillar6 90a417b331 Changed C++ to C (#21734)
Changed a reference to C++ to C.
2018-11-05 04:14:50 -05:00
jacheg 62bf5ad17d Changed the wording for the elements in an array. (#21729)
It was confusing before. Mentioned elements that didn't exist. Maybe meant indexes?
2018-11-05 04:13:33 -05:00
apurv22 b25fd77ed2 Changed 'method' to 'function' for relevancy. (#25037) 2018-11-05 13:45:07 +05:30
katiepillar6 1fa6cee420 changed a to b (#21770)
Changed (a) to (b) so it makes sense and reads logically.
2018-11-05 01:58:17 -05:00
jacheg dc09ca3e25 Updated typo and more info (#21787) 2018-11-04 20:59:47 -05:00
kenbhatt a674171714 My change is line 30. (#23571)
Printing hello, world correctly according to the code above given.
2018-11-04 13:18:04 -08:00
allenpbiju 6e42246d53 Added some info (#20123)
Some information has been added on how to define a function after the main program.
2018-11-03 21:14:27 -04:00
blankaex 528b7b413e Added missing spaces (#24171) 2018-11-02 14:43:29 +05:30
Bhuvan Singla 8230f82dd1 Add role of \n in explanation of the code (#20849) 2018-11-02 04:00:07 -04:00
Siddharth Shrivastav 8e843dc352 Add program in C to show variable (#20445) 2018-11-01 13:41:07 -04:00
Bennett Garner 538cab1134 Clarify concepts, rename a function (#20580) 2018-10-31 20:50:56 -07:00
Kirk Manegold e3afefd2a2 fix(guide): Add protocol information 2018-10-31 21:16:18 -04:00
Siddharth Shrivastav 8f4a27ae8a new information regarding hello world (#20263)
* new information regarding hello world 

 ## Extra
 * you know the first ever program you write was hello world program whether it be in any language.
 * It is because Brian Kernighan was the  first  to write "hello, world" program for the documentation of the BCPL programming language developed by Martin Richards.

* Fixed formatting and improved readability
2018-10-31 17:21:33 -05:00
akadidas b0df93cc26 Update index.md (#20535)
* Update index.md

Some improvisation and obvious corrections.

* fix: formatting
2018-10-30 22:23:54 -05:00
kenbhatt 48afcd0a3b Changes in lines 6 (#23612) 2018-10-29 15:44:29 -07:00
Pritom Hazarika 533adf6743 Update index.md (#21800)
* Update index.md 

Finding the bigger number using If Else

* Updated index.md

* Update index.md

* Update index.md
2018-10-29 15:10:51 -07:00
rajranjan0608 1024b3f039 Update index.md (#20355) 2018-10-29 12:52:43 -07:00
rajranjan0608 1e66276eda added the necessity of main() function (#20252)
* Update index.md

* grammar corrections
2018-10-29 09:10:39 -07:00
Siddharth Shrivastav c8aa2a4e9e star pattern using for loop (#20222)
## Example for printing star pattern for pyramid 
```c

#include<stdio.h>
int
main ()
{
  int i, j;
  for (i = 1; i <= 5; i++)
    {

      for (j = i; j < 5; j++)
	{
	  printf (" ");
	}


      for (j = 1; j <= (2 * i - 1); j++)
	{
	  printf ("*");
	}


      printf ("\n");
    }

  return 0;
}
```
## Output:
```shell 
     *
    ***
   *****
  *******
 ********* 

``
2018-10-28 15:06:09 -07:00
Yiğit Sever 11b1b150a8 Do not cast the result of malloc (#20044)
https://stackoverflow.com/a/605858/3005749, also expanded the definition of heap
2018-10-27 19:56:26 -07:00
SAKSHI-CHANDEL b6ad5afb70 Correcting a spelling mistake (#19845)
* Correcting a spelling mistake

* Formatting and adding missing code

* Removing extra code

* Update index.md
2018-10-26 03:29:30 -06:00
eliberator b32c93347c define the value of variable a to 100 (#27763) 2018-10-26 03:22:16 -06:00
Matt ca4812964e Added some info on recursion (#19814)
May be important info for some
2018-10-23 10:40:57 -05:00
Thomas Papapaschos b7836f87db update : handle division with zero & runtime error (#19620) 2018-10-23 22:50:19 +09:00
Thomas Papapaschos 4d0fad6e75 updated code parts for increased compatibility (#19621) 2018-10-23 22:49:32 +09:00
Tilak Singh 3115588b8f Update index.md (#25613) 2018-10-22 23:26:20 -07:00
Blaise Sebagabo 38d4c4c6cd added " C programming ressources link" (#21039)
* added " C programming ressources link"

This links to TutorialsPoint which is a good ressource for most of the programming languages

* Added "Unordered list for the tutorial element"
2018-10-22 14:58:42 -04:00
Akshay Avinash 720931c798 Definition change (#24081) 2018-10-22 11:30:41 -07:00
wolfwhocodes 0c1ca98205 Array variables have same data type (#23142)
An array is a set of homogeneous data. It's important to note that the variables in an array are always of the same data type.
2018-10-22 22:56:06 +05:30
chaudhary-anurag f97fec8cf5 Fixed typo in an example (#21436) 2018-10-20 01:57:46 +05:30
Prashanth Thiagarajan 09ee4821ee Update index.md (#21488) 2018-10-20 01:55:11 +05:30
Bouncey b1a785c87d fix(guide): Fix directory structure 2018-10-19 16:28:34 +01:00
Rahul Rawat ed55ef09bd Fixing typo in a Guide path(#19678) (#19696)
* Fixing typo in a Guide path(#19678)

* Fix the folder name to be lowercase and separated by hyphens
2018-10-18 09:04:21 +02:00
Thomas Papapaschos 7506631c77 fix spelling errors (#19616)
dinamic - > dynamic
2018-10-17 10:56:35 -07:00
Mrugesh Mohapatra da0df12ab7 fix(guide): simplify directory structure 2018-10-16 21:32:40 +05:30