GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Notizen

C Programming

amey mhaskar Englisch 1 Seite

Inhalt der Notizen (1)

Seite 1

Basics of C Programming:

#include <stdio.h> //A link to an external library file that handles standard input/output

int main(void) //A necessary function in every C program

//"int" means that this program must return an integer value

{

int aNumber; //An integer variable

printf( "Please enter a number: " ); //Display a message on the screen

scanf( "%d", &aNumber ); //Receive and store the value entered by the user

printf( "You entered %d", aNumber ); //Display feedback to the user about the recent input received

getchar(); //A "trick" to prevent the program window from closing by waiting

//for an additional character to be typed

return 0; //0 means execution was successful and the operating system is now informed

}

-printf () is used to display a message to the user

-scanf() is used to scan an input given by the user

Directives:

used to import libraries. There are 2 ways of doing this:

1) #include <package name>---- Used to refer to standard headers available with C

2) #include "package name"------ Used to refer or import user created headers or code

3) #define name ----- used to define a macro or a constant eg: #define BUFFER_SIZE 1024

Informationen

Beschreibung
Notiz am C Programming, erstellt von amey mhaskar am 03/11/2018.
Erstellt von
amey mhaskar · Nov 2018
Aktualisiert
3 Nov 2018
Aufrufe
0
Bewertung

Mehr zu C Programming Basics

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck