meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
digital:programmieren:c [2019/01/08 17:45]
natrius
digital:programmieren:c [2019/12/04 15:00]
natrius
Line 1: Line 1:
 # C # C
 +
 Zusammenfassung für nützliche Sachen beim Programmieren mit C. Zusammenfassung für nützliche Sachen beim Programmieren mit C.
  
 ## Ressourcen ## Ressourcen
 +
 +  * https://github.com/kozross/awesome-c#learning-reference-and-tutorials
   * https://de.wikibooks.org/wiki/C-Programmierung   * https://de.wikibooks.org/wiki/C-Programmierung
   * http://www.code-in-c.com/galton-board-in-c/   * http://www.code-in-c.com/galton-board-in-c/
   * http://www.c-howto.de/tutorial/einfuehrung/   * http://www.c-howto.de/tutorial/einfuehrung/
 +  * http://www.vazgames.com/retro/CPROG.htm
 +  * http://ergodic.ugr.es/cphys_pedro/c/c/ccourse.html
 +  * ALGORITHMS http://www-igm.univ-mlv.fr/~lecroq/string/index.html
 +  * Propositional Logic: Introduction https://www.youtube.com/watch?v=qV4htTfow-E&list=PL619166130C21EADA
 +  * https://www.gnu.org/software/libc/manual/html_node/Getopt.html
 +  * Allgemein, MultiOS-Gamedev: https://gist.github.com/flibitijibibo/b67910842ab95bb3decdf89d1502de88
 +  * https://www.reddit.com/r/C_Programming/comments/cep9zl/c_skill_tree_visual_guide_for_c_resources/
 +  * Structure my program https://www.reddit.com/r/C_Programming/comments/cadkxr/c_programming_beginner_needs_help/?sort=top
 +  * https://www.reddit.com/r/C_Programming/comments/b3f9n5/i_created_a_simple_tictactoe_game_and_am_looking/?sort=top
 +  * http://sekrit.de/webdocs/c/beginners-guide-away-from-scanf.html
 +  * http://rosettacode.org/wiki/Category:Programming_Tasks
 +
 +### Starting a project, planning
 +
 +  * https://www.quora.com/How-do-I-start-my-own-programming-projects-1
 +  * https://www.codeconquest.com/programming-projects/
 +  * https://www.khanacademy.org/computing/computer-programming/programming/good-practices/a/planning-a-programming-project
 +
 +### Games
 +
 +  * https://www.codingame.com/home
 +  * https://www.coderbyte.com/
 +  * https://www.reddit.com/r/C_Programming/comments/c3ap6f/i_just_started_a_new_project_on_github_with_code/?sort=top
 +  * https://projecteuler.net/
 +  * https://www.reddit.com/r/dailyprogrammer/
 +  * https://www.hackerrank.com/
 +  * paid? - https://www.topcoder.com/
 +
 +## Cheat Sheet
 +
 +### Main Function
 +
 +<code c>
 +void main(void) {
 +
 +}
 +</code>
 +
 +### Printf
 +
 +<code c>
 +#include <stdio.h>
 +
 +void main(void) {
 +    int i = 1;
 +    unsigned u = 2;
 +    long l = 3;
 +    float f = 4.0;
 +    double d = 5.0;
 +    char c = 6;
 +    unsigned char uc = 7;
 +
 +    printf("i = %d, u = %u, l = %l, f = %f, d = %lf, c = %c, c = %d, uc = %d\n",
 +            i, u, l, f, d, c, c, uc);
 +
 +    printf("print a tab by \t and new line by \n");
 +
 +}
 +</code>
 +
 +### Scanf
 +
 +<code c>
 +#include <stdio.h>
 +
 +void main(void) {
 +   int i;
 +
 +   printf("Print a prompt for i\n");
 +   scanf("%d", &i);
 +
 +}
 +</code>
 +
 +### Conditionals
 +
 +<code c>
 +if(flag) {
 +   // put some statements here to execute if flag is true (flag != 0)
 +
 +
 +if(flag) {
 +   // put some statements here to execute if flag is true (flag != 0)
 +} else {
 +   // put some statements here to execute if flag is false (flag == 0)
 +}
 +
 +switch(flag) {
 +    case 0:  // statements
 +    break;
 +    case 1:  // statements
 +  break;
 +    case 2:  // statements
 +  break;
 +    default:  // statements
 +
 +}
 +</code>
 +
 +### Looping
 +
 +<code c>
 +while(flag) {
 +    // make sure there is some statement in here to change flag to become false.
 +}
 +
 +for(i = 0; i < LAST; i++) {
 +    // statements
 +}
 +</code>
 +
 +### Math Functions
 +
 +<code c>
 +#include <math.h>
 +
 +void main(void) {
 +    double th = pi/2;    // th is in radians
 +    double x, y;
 +
 +    x = cos(th);
 +    y = sin(th);
 +    th = atan2(y, x);
 +}
 +</code>
 +
 +### Creating Functions
 +
 +<code c>
 +int functionname(type1 input1, ... , typeN *output1, ...);     // this is the function prototype with the ;
 +int functionname(type1 input1, ... , typeN *output1, ...)
 +{
 +    *output1 = // some function of the input variables.
 +    *output2 = // some function of the input varialbles.
 +    ...
 +    return(someintvalue);
 +}
 +</code>
  
 ## Input seperated with space or / ## Input seperated with space or /