Data update

This commit is contained in:
Ingy döt Net 2023-08-01 14:30:30 -07:00
parent 07c7092a52
commit 61b93a2cd1
313 changed files with 6160 additions and 346 deletions

View file

@ -811,6 +811,7 @@ Transact-SQL: .sql
Transd: .transd
TransFORTH: .fth
Trith: .trith
TRS-80 BASIC: .basic
True BASIC: .basic
TSE SAL: .tse
Turbo-Basic XL: .basic

View file

@ -0,0 +1 @@
../../Task/Best-shuffle/AArch64-Assembly

View file

@ -0,0 +1 @@
../../Task/Filter/AArch64-Assembly

View file

@ -0,0 +1 @@
../../Task/Sort-disjoint-sublist/AArch64-Assembly

1
Lang/ALGOL-W/Amicable-pairs Symbolic link
View file

@ -0,0 +1 @@
../../Task/Amicable-pairs/ALGOL-W

View file

@ -0,0 +1 @@
../../Task/Euclid-Mullin-sequence/ALGOL-W

1
Lang/ALGOL-W/Pell-numbers Symbolic link
View file

@ -0,0 +1 @@
../../Task/Pell-numbers/ALGOL-W

View file

@ -0,0 +1 @@
../../Task/Prime-decomposition/ANSI-BASIC

1
Lang/APL/Hex-words Symbolic link
View file

@ -0,0 +1 @@
../../Task/Hex-words/APL

View file

@ -0,0 +1 @@
../../Task/Best-shuffle/ARM-Assembly

1
Lang/ARM-Assembly/Filter Symbolic link
View file

@ -0,0 +1 @@
../../Task/Filter/ARM-Assembly

View file

@ -0,0 +1 @@
../../Task/Sort-disjoint-sublist/ARM-Assembly

View file

@ -0,0 +1 @@
../../Task/Bifid-cipher/Applesoft-BASIC

View file

@ -0,0 +1 @@
../../Task/Case-sensitivity-of-identifiers/Applesoft-BASIC

View file

@ -0,0 +1 @@
../../Task/Look-and-say-sequence/Applesoft-BASIC

View file

@ -1 +0,0 @@
../../Task/Case-sensitivity-of-identifiers/BASIC

View file

@ -0,0 +1 @@
../../Task/Abundant-deficient-and-perfect-number-classifications/BASIC256

View file

@ -0,0 +1 @@
../../Task/Goldbachs-comet/BASIC256

View file

@ -0,0 +1 @@
../../Task/Middle-three-digits/BASIC256

1
Lang/BASIC256/Number-names Symbolic link
View file

@ -0,0 +1 @@
../../Task/Number-names/BASIC256

View file

@ -0,0 +1 @@
../../Task/Sieve-of-Pritchard/BASIC256

1
Lang/Bait/Loops-While Symbolic link
View file

@ -0,0 +1 @@
../../Task/Loops-While/Bait

1
Lang/C++/Fortunate-numbers Symbolic link
View file

@ -0,0 +1 @@
../../Task/Fortunate-numbers/C++

1
Lang/C++/Hex-words Symbolic link
View file

@ -0,0 +1 @@
../../Task/Hex-words/C++

1
Lang/C++/History-variables Symbolic link
View file

@ -0,0 +1 @@
../../Task/History-variables/C++

View file

@ -0,0 +1 @@
../../Task/Holidays-related-to-Easter/C++

View file

@ -0,0 +1 @@
../../Task/Jordan-P-lya-numbers/C++

View file

@ -29,27 +29,27 @@ C has since spread to many other [[:Category:Platforms|platforms]], and is now o
==Overview==
===Curly Braces===
C uses curly braces as a separator for sections of code. All curly braces must be "balanced," i.e. every left curly brace must have a right curly brace after it. Nesting curly brace pairs inside curly braces is also acceptable as long as none of them are "lonely." Most advanced code editors will help you with curly braces by automatically typing the right brace as soon as you type the left one.
C uses curly braces as a separator for sections of code. All curly braces must be "balanced," i.e. every left curly brace must have a right curly brace after it. Nesting curly brace pairs inside curly braces is also acceptable as long as none of them are "lonely."
<lang C>int main()
{
Most advanced code editors will help you with curly braces by automatically typing the right brace as soon as you type the left one. It is a matter of style as to whether you prefer to place an opening curly brace on its own line or at the end of the previous line. Here we use the latter style.
// your main program goes here
// if you forgot either of these curly braces you would get an error message when you try to compile!
<syntaxhighlight lang="c">int main() {
}</lang>
// Your main program goes here.
// If you forgot either of these curly braces you would get an error message when you try to compile!
}</syntaxhighlight>
The contents of a function, if statement, etc. <b>must</b> be enclosed in curly braces for the code to count as part of that section.
<lang C>{
//this wouldn't actually compile as none of these variables were declared in this scope. More on that later.
<syntaxhighlight lang="c">{
// This wouldn't actually compile as none of these variables were declared in this scope. More on that later.
if (K == 3)
{
X = Y; //this line will be skipped if K doesn't equal 3.
}
Y = Z; //this is not part of the if statement. It will execute even if K doesn't equal 3.
if (K == 3) {
X = Y; // This line will be skipped if K doesn't equal 3.
}
Y = Z; // This is not part of the if statement. It will execute even if K doesn't equal 3.
}</lang>
}</syntaxhighlight>
===Semicolons===
Any "executable" statement must end in a semicolon, such as an assignment or function call. If you get an error message from your compiler, it won't explicitly tell you "Expected semicolon at end of line X." Go to the line number it says the error is at, and look a few lines <i>above</i> that. You might have forgotten a semicolon there.
@ -59,58 +59,57 @@ Unlike assembly which lets you jump anywhere or read any memory address, C impos
===Functions===
A function is made up of three parts: its return type, its name, and its arguments.
<lang C>int main(void) //This is the function "main," which takes no arguments and returns a 32-bit signed integer value.
<syntaxhighlight lang="c">int main(void) // This is the function "main," which takes no arguments and returns a 32-bit signed integer value.
int sum(int a,int b) //This is the function "sum," which takes two integer arguments and returns an integer.
int sum(int a, int b) // This is the function "sum," which takes two integer arguments and returns an integer.
void PlaySound(char songName)
//This takes a character string as an argument and presumably sends a command to sound hardware.
//It returns no values. Functions that have a return value of "void" typically do some sort of
//procedure whose outcome does not need to be measured or remembered later.</lang>
// This takes a character string as an argument and presumably sends a command to sound hardware.
// It returns no values. Functions that have a return value of "void" typically do some sort of
// procedure whose outcome does not need to be measured or remembered later.</syntaxhighlight>
Note that the variable names listed as arguments when declaring a function are known as <i>formal parameters</i> and only are there to define the function. Variables with those names need not be declared or defined in your actual function, nor do they refer to any variables in your program that happen to have the same name. Essentially, formal parameters act as placeholders for the actual function parameters that you'll be using.
<lang C>int foo(int x){
return x;
<syntaxhighlight lang="c">int foo(int x) {
return x;
} // "x" doesn't need to be a variable in your real program. If it is, that's not related in any way to the "x" here.
int main()
{
int main() {
int y;
int z = 2;
int y;
int z = 2;
y = foo(z); //note that x was never involved. That's because the "x" earlier was the formal parameter.
y = foo(z); // Note that x was never involved. That's because the "x" earlier was the formal parameter.
}</lang>
}</syntaxhighlight>
===Assignment===
C allows you to define a variable as equal to a value, in more ways than just simple numerals.
<lang C>int a = 3; //declare the variable a of type int, define it equal to decimal 3.
<syntaxhighlight lang="c">int a = 3; // Declare the variable a of type int, define it equal to decimal 3.
int b = -1; //declare the variable b of type int, define it equal to -1 (0xFFFFFFFF in hex)
int b = -1; // Declare the variable b of type int and equal to -1 (0xFFFFFFFF in hex).
char letter = "A";
//declare the variable "letter" of type char, it equals capital A.
//C allows you to treat an ascii value as its numeric equivalent whenever you feel like it. Other languages do not.
// Declare the variable "letter" of type char and equal to capital A.
// C allows you to treat an ascii value as its numeric equivalent whenever you feel like it. Other languages do not.
char myString = "Hello"; //define the array "myString" containing the letters "Hello" followed by a null terminator.
char *myString = "Hello"; // Define the array "myString" containing the letters "Hello" followed by a null terminator.
int myArray[5] = {10,20,30,40,50};
//declare the array variable "myArray" containing integer values, with a maximum size of 5 elements.
//Then assign 10 to the beginning, 20 after it, 30 after that, and so on.
int myArray[5] = {10, 20, 30, 40, 50};
// Declare the array variable "myArray" containing integer values, with a maximum size of 5 elements.
// Then assign 10 to the beginning, 20 after it, 30 after that, and so on.
int c = sum(a,b);
//declare the integer variable "c".
//Define it to equal the output of the function sum using the previously defined variables "a" and "b" as arguments.
//When this line of code is executed, the computer will perform the function "sum(a,b)" and store the result in c.
//This is only valid if the return type of the function "sum" matches the type of the variable "c."</lang>
int c = sum(a, b);
// Declare the integer variable "c".
// Define it to equal the output of the function sum using the previously defined variables "a" and "b" as arguments.
// When this line of code is executed, the computer will perform the function "sum(a,b)" and store the result in c.
// This is only valid if the return type of the function "sum" matches the type of the variable "c."</syntaxhighlight>
===Declaring vs. Defining===
This is a very unintuitive aspect of C that often confuses new users. Declaring a variable or function tells the compiler that a function may exist. Defining a variable or function assigns it a value or procedure, respectively. Compare the two examples below:
<lang C>int a; // The variable "a" has been declared, but not defined.
a = 2; // Now the variable has been defined.</lang>
<syntaxhighlight lang="c">int a; // The variable "a" has been declared, but not defined.
a = 2; // Now the variable has been defined.</syntaxhighlight>
<lang C>int a = 2; //The variable "a" has been both declared and defined.</lang>
<syntaxhighlight lang="c">int a = 2; // The variable "a" has been both declared and defined.</syntaxhighlight>
* You cannot define a variable without declaring it first.
* Before a variable can be used, it must be defined.
@ -129,13 +128,13 @@ You can also add a few modifiers in front of the variable type to be more specif
* <code>volatile</code> tells the compiler that this variable's value can changed by the hardware. This is commonly used for hardware registers such as those that track the mouse cursor's location, a scanline counter, etc. The value will always be read from its original memory location, ensuring that its value is always up-to-date.
Examples:
<lang C>unsigned int x;
volatile int HorizontalScroll;</lang>
<syntaxhighlight lang="c">unsigned int x;
volatile int HorizontalScroll;</syntaxhighlight>
Functions are declared in a similar fashion to variables, except a function's "type" is the type of the value it returns.
<lang C>int foo(int bar);
<syntaxhighlight lang="c">int foo(int bar);
// The function foo was declared. It takes an integer as an argument and returns an integer.
// What it actually does is currently unknown but can be defined later.</lang>
// What it actually does is currently unknown but can be defined later.</syntaxhighlight>
==Citation==
*[[wp:C_%28programming_language%29|Wikipedia:C (programming language)]]

View file

@ -0,0 +1 @@
../../Task/Command-line-arguments/C3

1
Lang/C3/Loops-Continue Symbolic link
View file

@ -0,0 +1 @@
../../Task/Loops-Continue/C3

1
Lang/C3/Loops-Do-while Symbolic link
View file

@ -0,0 +1 @@
../../Task/Loops-Do-while/C3

1
Lang/C3/Loops-Downward-for Symbolic link
View file

@ -0,0 +1 @@
../../Task/Loops-Downward-for/C3

1
Lang/C3/Loops-For Symbolic link
View file

@ -0,0 +1 @@
../../Task/Loops-For/C3

View file

@ -0,0 +1 @@
../../Task/Loops-For-with-a-specified-step/C3

1
Lang/C3/Loops-Foreach Symbolic link
View file

@ -0,0 +1 @@
../../Task/Loops-Foreach/C3

1
Lang/C3/Loops-Infinite Symbolic link
View file

@ -0,0 +1 @@
../../Task/Loops-Infinite/C3

View file

@ -0,0 +1 @@
../../Task/Abundant-deficient-and-perfect-number-classifications/Chipmunk-Basic

View file

@ -0,0 +1 @@
../../Task/Ackermann-function/Chipmunk-Basic

View file

@ -0,0 +1 @@
../../Task/Amicable-pairs/Chipmunk-Basic

View file

@ -0,0 +1 @@
../../Task/Case-sensitivity-of-identifiers/Chipmunk-Basic

View file

@ -0,0 +1 @@
../../Task/Look-and-say-sequence/Chipmunk-Basic

View file

@ -0,0 +1 @@
../../Task/Pseudo-random-numbers-Middle-square-method/Chipmunk-Basic

View file

@ -0,0 +1 @@
../../Task/Sort-disjoint-sublist/Chipmunk-Basic

View file

@ -0,0 +1 @@
../../Task/Execute-Brain-/Commodore-BASIC

View file

@ -0,0 +1 @@
../../Task/Case-sensitivity-of-identifiers/Cowgol

View file

@ -0,0 +1 @@
../../Task/Case-sensitivity-of-identifiers/Dart

View file

@ -0,0 +1 @@
../../Task/Pick-random-element/Dart

1
Lang/Dart/Yin-and-yang Symbolic link
View file

@ -0,0 +1 @@
../../Task/Yin-and-yang/Dart

View file

@ -0,0 +1 @@
../../Task/Case-sensitivity-of-identifiers/Draco

View file

@ -0,0 +1 @@
../../Task/Sieve-of-Pritchard/FreeBASIC

View file

@ -0,0 +1 @@
../../Task/Abundant-deficient-and-perfect-number-classifications/FutureBasic

View file

@ -0,0 +1 @@
../../Task/Amicable-pairs/FutureBasic

View file

@ -0,0 +1 @@
../../Task/Ascending-primes/FutureBasic

View file

@ -0,0 +1 @@
../../Task/Bell-numbers/FutureBasic

View file

@ -0,0 +1 @@
../../Task/Compare-a-list-of-strings/FutureBasic

View file

@ -0,0 +1 @@
../../Task/Create-a-two-dimensional-array-at-runtime/FutureBasic

View file

@ -0,0 +1 @@
../../Task/Descending-primes/FutureBasic

View file

@ -0,0 +1 @@
../../Task/Duffinian-numbers/FutureBasic

View file

@ -0,0 +1 @@
../../Task/Emirp-primes/FutureBasic

View file

@ -0,0 +1 @@
../../Task/Extensible-prime-generator/FutureBasic

View file

@ -0,0 +1 @@
../../Task/Write-entire-file/FutureBasic

View file

@ -0,0 +1 @@
../../Task/Case-sensitivity-of-identifiers/GW-BASIC

View file

@ -0,0 +1 @@
../../Task/Sort-disjoint-sublist/GW-BASIC

View file

@ -0,0 +1 @@
../../Task/Abundant-deficient-and-perfect-number-classifications/Gambas

1
Lang/Gambas/Amicable-pairs Symbolic link
View file

@ -0,0 +1 @@
../../Task/Amicable-pairs/Gambas

1
Lang/Gambas/Wagstaff-primes Symbolic link
View file

@ -0,0 +1 @@
../../Task/Wagstaff-primes/Gambas

View file

@ -1,3 +1,7 @@
{{stub}}{{language|Insitux
|site=https://insitux.github.io}}
{{stub}}
{{language|Insitux
|site=https://insitux.github.io
|hopl=no
|tags=insitux}}
{{language programming paradigm|functional}}

1
Lang/Insitux/ABC-problem Symbolic link
View file

@ -0,0 +1 @@
../../Task/ABC-problem/Insitux

1
Lang/Insitux/Amb Symbolic link
View file

@ -0,0 +1 @@
../../Task/Amb/Insitux

View file

@ -0,0 +1 @@
../../Task/Attractive-numbers/Insitux

1
Lang/Insitux/Comments Symbolic link
View file

@ -0,0 +1 @@
../../Task/Comments/Insitux

1
Lang/Insitux/Flatten-a-list Symbolic link
View file

@ -0,0 +1 @@
../../Task/Flatten-a-list/Insitux

View file

@ -0,0 +1 @@
../../Task/Generate-lower-case-ASCII-alphabet/Insitux

View file

@ -0,0 +1 @@
../../Task/Letter-frequency/Insitux

View file

@ -0,0 +1 @@
../../Task/First-class-environments/Java

View file

@ -0,0 +1 @@
../../Task/First-class-functions-Use-numbers-analogously/Java

1
Lang/Java/Fortunate-numbers Symbolic link
View file

@ -0,0 +1 @@
../../Task/Fortunate-numbers/Java

1
Lang/Java/Goldbachs-comet Symbolic link
View file

@ -0,0 +1 @@
../../Task/Goldbachs-comet/Java

1
Lang/Java/Gotchas Symbolic link
View file

@ -0,0 +1 @@
../../Task/Gotchas/Java

View file

@ -0,0 +1 @@
../../Task/HTTPS-Authenticated/Java

View file

@ -0,0 +1 @@
../../Task/HTTPS-Client-authenticated/Java

View file

@ -0,0 +1 @@
../../Task/Halt-and-catch-fire/Java

1
Lang/Java/Hex-words Symbolic link
View file

@ -0,0 +1 @@
../../Task/Hex-words/Java

1
Lang/Java/Home-primes Symbolic link
View file

@ -0,0 +1 @@
../../Task/Home-primes/Java

View file

@ -0,0 +1 @@
../../Task/Jordan-P-lya-numbers/Java

1
Lang/Lua/Bifid-cipher Symbolic link
View file

@ -0,0 +1 @@
../../Task/Bifid-cipher/Lua

View file

@ -0,0 +1 @@
../../Task/Euclid-Mullin-sequence/Lua

1
Lang/Lua/Hex-words Symbolic link
View file

@ -0,0 +1 @@
../../Task/Hex-words/Lua

View file

@ -0,0 +1 @@
../../Task/Hofstadter-Q-sequence/Lua

1
Lang/Lua/Long-year Symbolic link
View file

@ -0,0 +1 @@
../../Task/Long-year/Lua

1
Lang/MACRO-11/Binary-search Symbolic link
View file

@ -0,0 +1 @@
../../Task/Binary-search/MACRO-11

View file

@ -0,0 +1 @@
../../Task/Case-sensitivity-of-identifiers/MSX-Basic

View file

@ -0,0 +1 @@
../../Task/Mandelbrot-set/MSX-Basic

View file

@ -0,0 +1 @@
../../Task/Amicable-pairs/MiniScript

View file

@ -0,0 +1 @@
../../Task/Euclid-Mullin-sequence/MiniScript

View file

@ -0,0 +1 @@
../../Task/Case-sensitivity-of-identifiers/Minimal-BASIC

View file

@ -0,0 +1 @@
../../Task/Sort-disjoint-sublist/Minimal-BASIC

1
Lang/Modula-2/Binary-search Symbolic link
View file

@ -0,0 +1 @@
../../Task/Binary-search/Modula-2

View file

@ -0,0 +1 @@
../../Task/Prime-decomposition/Modula-2

View file

@ -0,0 +1 @@
../../Task/Case-sensitivity-of-identifiers/N-t-roff

Some files were not shown because too many files have changed in this diff Show more