<commit_before>---
layout: language
icon: icon-c

Language: C
Language_Description: General purpose, low-level programming language.

Data Types:
- Type: Basic variables
  Description: Declares a variable of one of the basic built-in types.
  Syntax: typename variablename
  Example: |
           int x, y=3
           float f;
           char c;
  Example_Description: declares two integers, x and y. y is initialized to 3. declares a floating point variable, f and a char(1 byte) variable c.

- Type: Array
  Description: For storing a list of things
  Syntax: |
          //declaration
          typename arrayname[ARRAY_SIZE];
          //access the nth element
          arrayname[n-1]  //arrays are indexed starting at 0
  Example: |
           int primes[10] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
           int five = primes[2];

- Type: Struct
  Description: Declares a data type with several member variables. Structs are used to group variables together.
  Syntax: |
          //define the structure
          struct mystruct
          {
            typename membername;
            ...
          };
          //declare an instance
          struct mystruct instancename;
  Example: |
           struct point
           {
            int x, y;
           };
           struct point begin, end;
           begin.x = 0;
           begin.y = 0;
  Example_Description: Defines a struct called point, than creates 2 instances, called begin and end. The x and y members of begin are then set to 0.

- Type: Pointer
  Description: Data type for storing locations in memory.
  Syntax: typename * ptr_var;
  Example: |
           int * pA, *pB;
           int a = 3, b = 5, c = 0;
           pA = &a;
           pB = &b;
           c = *pA; //c is now 3
           a = *pB; //a is now 5, and *pA is also 5


Flow Control:
- Type: if/else if /else
  Description: Basic if else statement common to most languages
  Syntax: if(condition) {code} else if (condition2) {code} else {code}
  Example: |<commit_msg>added string type to data types header<commit_after>---
layout: language
icon: icon-c

Language: C
Language_Description: General purpose, low-level programming language.

Data Types:
- Type: Basic variables
  Description: Declares a variable of one of the basic built-in types.
  Syntax: typename variablename
  Example: |
           int x, y=3
           float f;
           char c;
  Example_Description: declares two integers, x and y. y is initialized to 3. declares a floating point variable, f and a char(1 byte) variable c.

- Type: Array
  Description: For storing a list of things
  Syntax: |
          //declaration
          typename arrayname[ARRAY_SIZE];
          //access the nth element
          arrayname[n-1]  //arrays are indexed starting at 0
  Example: |
           int primes[10] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
           int five = primes[2];

- Type: Struct
  Description: Declares a data type with several member variables. Structs are used to group variables together.
  Syntax: |
          //define the structure
          struct mystruct
          {
            typename membername;
            ...
          };
          //declare an instance
          struct mystruct instancename;
  Example: |
           struct point
           {
            int x, y;
           };
           struct point begin, end;
           begin.x = 0;
           begin.y = 0;
  Example_Description: Defines a struct called point, than creates 2 instances, called begin and end. The x and y members of begin are then set to 0.

- Type: Strings
  Description: Null-terminated strings. Strings are just arrays of chars
  Syntax: char string[13] = "Hello World!";

- Type: Pointer
  Description: Data type for storing locations in memory.
  Syntax: typename * ptr_var;
  Example: |
           int * pA, *pB;
           int a = 3, b = 5, c = 0;
           pA = &a;
           pB = &b;
           c = *pA; //c is now 3
           a = *pB; //a is now 5, and *pA is also 5


Flow Control:
- Type: if/else if /else
  Description: Basic if else statement common to most languages
  Syntax: if(condition) {code} else if (condition2) {code} else {code}
  Example: |
{'fraction_non_alphanumeric': 0.08351280210576693, 'fraction_numerical': 0.01722900215362527, 'mean_word_length': 1.9878484631879914, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3670320', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1167, 'n_words': 514}