learn C basic tutorial
Posted by kll on April 13 2020 08:09:02
we come from learn C ( on a Win 10 PC or Raspberry Pi ) and here:
FOR loop
keyboard input
our first function
many function
time lib
action every second
timer function
keyboard text to file


after we setup and tested CODE::"BLOCKS ( on win 10 PC or Raspberry Pi )
now you can start learning C coding: variables / math / if / for / ...
but not in a lifetime you could write a program for desktop,
with a window , operation menu ( buttons..), file handling , graphic output,
for this you need to use one of the additional GUI tools and libraries, what come with this IDE as ready templates, like:
QT , wx, GTK, win32GUI
but the tools you need to install additionally, basically the library and a window designer tool.

pls. understand that i am NOT a C programmer,
after 30 years in the industry as computer & instrument engineer,
i play many years
* C++ Arduino coding,
* Processing JAVA & JS,
* Python apps
also many other things, including
* web- server and design...
but i am actually not qualified to make a C Tutorial!

after have the CODE::BLOCKS installation tested, by use
+ new project
+ select console application
+ build
+ run

FOR loop

we start with our first code: a easy FOR loop to print lines

keyboard input

we try a keyboard input of two numbers and print out the result of a+b=

our first function

now we do same, but try to put the sum calculation and the print into one function

many function

when we use many function with good naming our main program stays short
and is easy readable.

time lib

start to play with the TIME library, first print current time

action every second

try a C_program what prints lines every second

timer function

and a repeating timer function

keyboard text to file

get a string ( line ) from keyboard and save it in ( at end of ) a file (append)


make a program what runs forever, until enter 'e' from keyboard
declare a static / array long 10 / filled with any integer numbers
on keyboard entry 0 .. 9 print this number and also the value from the array with this as the index


now we play already variables and arrays, but how about class?
well while C++ / JAVA ... knows them C closest thing is a struct,
with this you can build a multi type record.
and making a array of struct should be something you can call database ( or table )
as used for JSON or CSV files... or after you combine it with functions ( C++ call it methods )
a class alike.

make a program what creates a record for books ( title / author / book_id )
and a array of it ( database / filled manually )
add a record print function

here we are at the end of the basic C tutorial.

back to learn C ( on a Win 10 PC or Raspberry Pi )