-----------------------------------------------------------------------------

Date: 22.09.2023.

From Dragan Milicev,

You can find all my C programs at Dragan Milicev's pastebin:

 

https://pastebin.com/u/dmilicev

           

https://www.facebook.com/dmilicev

 

-----------------------------------------------------------------------------

 

Answers all in one, which programming language to choose and from where to learn:

 

Here is a table that can help you choose the language to learn:

Popularity of Programming Language

Worldwide, September 2019 compared to a year ago:

https://www.w3resource.com/python-exercises/

 

Here you have an interesting comparison of 4 languages on a simple task,

C++, C, Java i Python, the similarities and differences of these languages are seen.

https://www.w3resource.com/python/python-tutorial.php

 

Most Popular Programming Languages 1965. - 2019.

https://www.youtube.com/watch?v=Og847HVwRSI

 

 Tutorials with complete tasks for all languages

https://www.w3resource.com/

https://www.tutorialspoint.com/index.htm

 Complete library:

https://www.tutorialspoint.com/tutorialslibrary.htm

 

 Good eBooks for professionals

https://goalkicker.com/

 

 C

https://www.tutorialspoint.com/cprogramming/index.htm

https://www.w3resource.com/c-programming/programming-in-c.php

https://www.w3resource.com/c-programming-exercises/

https://www.tutorialspoint.com/learn_c_by_examples/

https://www.programiz.com/c-programming/examples

https://www.studytonight.com/c/programs/

https://www.includehelp.com/c/

https://www.includehelp.com/c-programming-examples-solved-c-programs.aspx

https://www.learn-c.org/en/Linked_lists

https://hackr.io/tutorials/learn-c

https://www.google.com/search?q=c+program+questions

https://www.geeksforgeeks.org/commonly-asked-c-programming-interview-questions-set-1/

https://www.faceprep.in/c/c-programming-questions/

https://www.studytonight.com/c/programs/pointer/memory-management-program

https://www.studytonight.com/c/programs/numbers/input-number-is-int-or-float

https://www.softwaretestinghelp.com/c-programming-interview-questions/

https://www.tutorialspoint.com/cprogramming/cprogramming_interview_questions.htm

https://www.edureka.co/blog/interview-questions/c-programming-interview-questions/

https://www.indiabix.com/c-programming/questions-and-answers/

https://www.sanfoundry.com/c-interview-questions-answers/

https://q4interview.com/c-programming/

https://q4interview.com/c-programming/complicated-declarations/all/1/1

https://fresh2refresh.com/c-programming/c-interview-questions-answers/

 Program language C Dennis M. Ritchie Brian W. Kernighan, they are invented C.

https://kremlin.cc/k&r.pdf

 C Notes for Professionals book

https://goalkicker.com/CBook/CNotesForProfessionals.pdf

http://www.skiet.org/downloads/cprogrammingquestion.pdf

 Objective-C Notes for Professionals book

https://goalkicker.com/ObjectiveCBook/ObjectiveCNotesForProfessionals.pdf

 

 C++

https://www.learncpp.com/

https://learncodehere.com/cplusplus/cplus.php

https://www.tutorialspoint.com/cplusplus/index.htm

https://www.w3schools.com/cpp/default.asp

https://www.w3resource.com/cpp-exercises/

 C++, free course

https://www.udemy.com/course/free-learn-c-tutorial-beginners/

 Book about algorithms, G.Polya "How To Solve It", Stanford University, California

https://math.hawaii.edu/home/pdf/putnam/PolyaHowToSolveIt.pdf

 Book "The Algorithm Design Manual" Steven Skiena

http://mimoza.marmara.edu.tr/~msakalli/cse706_12/SkienaTheAlgorithmDesignManual.pdf

 "Starting Out With Programming Logic and Design", by Tony Gaddis

https://cdn.inst-fs-iad-prod.inscloudgate.net/6e7f524c-959e-4422-b8dc-977c25b615aa/Gaddis%20_StartingOutWithProgrammingLogicAndDesign3rdEd.pdf?token=eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCIsImtpZCI6ImNkbiJ9.eyJyZXNvdXJjZSI6Ii82ZTdmNTI0Yy05NTllLTQ0MjItYjhkYy05NzdjMjViNjE1YWEvR2FkZGlzJTIwX1N0YXJ0aW5nT3V0V2l0aFByb2dyYW1taW5nTG9naWNBbmREZXNpZ24zcmRFZC5wZGYiLCJ0ZW5hbnQiOiJjYW52YXMiLCJ1c2VyX2lkIjpudWxsLCJpYXQiOjE2MDE2MDQwMDIsImV4cCI6MTYwMTY5MDQwMn0.J5U4JdYB-kQfv4mzz1kpyDCB5kNL3HuW3K7WLszgVdFAIf88aLBSbr2B0Iie79Xpfz9C7I_cSC9d50vA1hg-hw&download=1&content_type=application%2Fpdf

 "Starting Out with C++ from Control Structures to Objects" (8th Edition), by Tony Gaddis

https://staff.emu.edu.tr/sebnemcoban/Documents/itec243/StartingOutwithC++.pdf

 "Starting Out with C++ from Control Structures through objects" (6th Edition), by Tony Gaddis

https://cplusplushelp.weebly.com/uploads/2/5/6/5/25655197/0136022537.pdf

 C++ Primer (third edition) by Stanley Lippman

http://index-of.es/C++/Addison.Wesley.C++%20Primer.By.Stanley%20B.%20Lippman.pdf

 

 C++ Primer (fifth edition) by Stanley Lippman

http://ptgmedia.pearsoncmg.com/images/9780321714114/samplepages/0321714113.pdf

 C++ Primer (fourth edition) by Stanley Lippman

http://read.pudn.com/downloads132/ebook/564800/C++%20Primer%204th%20%E8%8B%B1%E6%96%87%E7%89%88.pdf

The Definitive C++ Book Guide and List

https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list?fbclid=IwAR1gdv7kDHUaqWNoNbHKB_s4nlf9lAAWqoJ6ah5EwgPox9DYo2vAisNxh2g

 C++ best ebook in OOP C++, C++ Notes for Professionals book, 600 pages

https://books.goalkicker.com/CPlusPlusBook/CPlusPlusNotesForProfessionals.pdf

 C++ , books, The Definitive C++ Book Guide and List

https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list

 C++, OOP in C++

https://www.computerscienceai.com/2019/12/object-oriented-programming-in-cpp.html

 Links from The Joyful Programmer:

https://web.facebook.com/thejoyfulprogrammer

The official C++ website:

https://isocpp.org/

The Core CPP Guidelines:

http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines

The C++ Reference Site:

https://en.cppreference.com/w/Main_Page

A list of all the C++ headers up to C++ ver20:

https://en.cppreference.com/w/cpp/header

A site with somewhat outdated, but very usuable information:

http://www.cplusplus.com/reference/

The Joyful Programmer GitHub page:

https://github.com/TheJoyfulProgrammer

 

 Java 8

https://www.tutorialspoint.com/java8/index.htm

https://www.w3schools.com/java/default.asp

https://www.w3resource.com/java-exercises/

https://learncodehere.com/java/java.php

https://dev.to/javinpaul/101-coding-problems-and-few-tips-to-crack-your-next-programming-interviews-402a

 Java Notes for Professionals book

https://goalkicker.com/JavaBook/JavaNotesForProfessionals.pdf

 

 Java Script

https://www.tutorialspoint.com/javascript/index.htm

https://www.w3schools.com/js/default.asp

https://www.w3resource.com/javascript-exercises/

https://learncodehere.com/javascript/javascript.php

 

 jQuery

jQuery Notes for Professionals book

https://goalkicker.com/jQueryBook/jQueryNotesForProfessionals.pdf

https://learncodehere.com/jquery/jquery.php

 

Node.js

https://learncodehere.com/nodejs/nodejs.php

 

 Python

https://www.tutorialspoint.com/python/index.htm

https://www.w3schools.com/python/

https://www.w3resource.com/python-exercises/

https://learncodehere.com/python/python.php

25 Best Online Python Courses to Learn in 2019

https://gainfromhere.com/best-online-python-courses-to-learn/?fbclid=IwAR22A6zHRAhoRhwCw6Um0AQFk6qBaHtneSUJjXMvwyAPxmoJmdQqWuCu-UY

 

 C#

https://www.tutorialspoint.com/csharp/index.htm

https://www.w3resource.com/csharp-exercises/

https://learncodehere.com/csharp/csharp.php

 C# Notes for Professionals book

https://goalkicker.com/CSharpBook/CSharpNotesForProfessionals.pdf

 Free Udemy course C# intermediate

https://www.onlinefreecourse.net/c-intermediate-classes-interfaces-and-oop-udemy-free-download/

 

 R

R Notes for Professionals book

https://goalkicker.com/RBook/RNotesForProfessionals.pdf

 

 .NET Framework, DOT NET Framework

.NET Framework Notes for Professionals book

https://goalkicker.com/DotNETFrameworkBook/DotNETFrameworkNotesForProfessionals.pdf

 

 HTML

https://www.tutorialspoint.com/html/index.htm

https://www.w3resource.com/html-css-exercise/index.php

https://www.tutorialrepublic.com/html-examples.php

https://learncodehere.com/html/html.php

 HTML5 Notes for Professionals book

https://goalkicker.com/HTML5Book/HTML5NotesForProfessionals.pdf

 

 CSS

https://www.tutorialspoint.com/css/index.htm

https://www.w3resource.com/html-css-exercise/index.php

https://www.tutorialrepublic.com/css-examples.php

https://learncodehere.com/css/css.php

 CSS, great for different screen resolutions of the devices

https://www.w3schools.com/css/default.asp

https://www.tutorialspoint.com/css/css_responsive.htm

 Responsive Web Design

https://www.w3schools.com/css/css_rwd_intro.asp

https://www.w3schools.com/bootstrap/default.asp

https://www.w3schools.com/css/css_rwd_templates.asp

https://www.w3schools.com/w3css/tryw3css_templates_start_page.htm

 W3.CSS

https://www.w3schools.com/w3css/default.asp

 CSS Notes for Professionals book

https://goalkicker.com/CSSBook/CSSNotesForProfessionals.pdf

 

 PHP

https://www.tutorialspoint.com/php/index.htm

https://www.w3schools.com/php/default.asp

https://www.w3resource.com/php-exercises/

https://www.tutorialrepublic.com/php-examples.php

https://learncodehere.com/php/php.php

 PHP Notes for Professionals book

https://goalkicker.com/PHPBook/PHPNotesForProfessionals.pdf

 

 SQL

https://www.tutorialspoint.com/sql/index.htm

https://www.w3schools.com/sql/default.asp

https://www.w3resource.com/sql-exercises/

https://learncodehere.com/sql/sql.php

 SQL Notes for Professionals book

https://goalkicker.com/SQLBook/SQLNotesForProfessionals.pdf

 

 MySQL

https://www.tutorialspoint.com/mysql/index.htm

https://www.w3resource.com/mysql-exercises/

https://learncodehere.com/mysql/mysql.php

 MySQL Notes for Professionals book

https://goalkicker.com/MySQLBook/MySQLNotesForProfessionals.pdf

 

 Microsoft SQL Server

Microsoft SQL Server Notes for Professionals book

https://goalkicker.com/MicrosoftSQLServerBook/MicrosoftSQLServerNotesForProfessionals.pdf

 

 Oracle

Oracle Database Notes for Professionals book

https://goalkicker.com/OracleDatabaseBook/OracleDatabaseNotesForProfessionals.pdf

 

 MS Excel

https://www.tutorialspoint.com/excel/index.htm

https://www.w3resource.com/excel/

 Excel VBA Notes for Professionals book

https://goalkicker.com/ExcelVBABook/ExcelVBANotesForProfessionals.pdf

 

 MS Word

https://www.tutorialspoint.com/word/index.htm

 

 MS Access

https://www.tutorialspoint.com/ms_access/index.htm

 

 MS PowerPoint

https://www.tutorialspoint.com/powerpoint/index.htm

 

 VBA

https://www.tutorialspoint.com/vba/index.htm

VBA Notes for Professionals book

https://goalkicker.com/VBABook/VBANotesForProfessionals.pdf

 

Oracle

https://www.w3resource.com/oracle-exercises/

 

 Visual Basic .NET

Visual Basic .NET Notes for Professionals book

https://goalkicker.com/VisualBasic_NETBook/VisualBasic_NETNotesForProfessionals.pdf

 

 Git

Git Notes for Professionals book

https://goalkicker.com/GitBook/GitNotesForProfessionals.pdf

 

 Algorithms

Algorithms Notes for Professionals book

https://goalkicker.com/AlgorithmsBook/AlgorithmsNotesForProfessionals.pdf

 

 Linux

Linux Notes for Professionals book

https://goalkicker.com/LinuxBook/LinuxNotesForProfessionals.pdf

 

 MATLAB

MATLAB Notes for Professionals book

https://goalkicker.com/MATLABBook/MATLABNotesForProfessionals.pdf

 

 LaTex

LaTeX Notes for Professionals book

https://goalkicker.com/LaTeXBook/LaTeXNotesForProfessionals.pdf

 

 Android

Android Notes for Professionals book

https://goalkicker.com/AndroidBook/AndroidNotesForProfessionals.pdf

 

-----------------------------------------------------------------------------

 

First learn C. Then C++, Java, C#, Pyton.

 

After first language, you'll find that others are very similar.

 

Most important thing is to learn algorithms, programming logic, after that it's easy to translate on every language.

 

C has the best help on the internet.

 

First learn C patterns with for loops, then strings, arrays, pointers, working with files, matrices, structures, linked lists.

 

After that learn object oriented languages like C++, Java od Python.

 

After CodeBlocks, use Eclipse for Java and MS Visual Studio,

which is the best of all.

 

Free serious programming courses recommended

(lasts a couple of months, a certificate is obtained)

https://www.coursera.org/

https://www.freecodecamp.org/

 

. . .

 

You can find all my C programs at Dragan Milicev's pastebin:

 

            https://pastebin.com/u/dmilicev

           

            https://www.facebook.com/dmilicev

           

-----------------------------------------------------------------------------

 

Please, don't send me your friend request because there is no need to be friends over facebook.

 

This is my private facebook account and all my friends are from my country and speak my language.

 

Also, my facebook account has nothing to do with programming.

 

Don't be mad at me for that my princip, please.

 

I am a member of many groups and I hope we can work together through those groups.

 

You can find all my C programs at Dragan Milicev's pastebin:

 

https://pastebin.com/u/dmilicev

 

https://www.facebook.com/dmilicev

 

-----------------------------------------------------------------------------

 

In your C program, #include on its place write header text file instead of you.

You may do it yourself and if so, then there is no need for include. Imagine

how it will be to write necessary header files at the begging of every your

program! Instead of that you only write #include...

 

-----------------------------------------------------------------------------

 

First things first.

 

The old saying "Don't try to run before you can walk".

 

First learn C patterns with for loop, then strings, arrays, pointers, working with files, matrices, structures, linked lists.

 

After that learn object oriented languages like C++, Java od Python.

 

 

C

 

 Program language C Dennis M. Ritchie Brian W. Kernighan, they are invented C.

 

https://kremlin.cc/k&r.pdf

 

C For Loop [59 exercises with solution]

https://www.w3resource.com/c-programming-exercises/for-loop/index.php

 

C strings (string is character array, array of characters)

 

https://www.tutorialspoint.com/cprogramming/c_strings.htm

 

 

C dynamic memory allocation

 

https://www.geeksforgeeks.org/dynamic-memory-allocation-in-c-using-malloc-calloc-free-and-realloc/

https://www.programiz.com/c-programming/c-dynamic-memory-allocation

 

 

C arrays

 

https://www.tutorialspoint.com/cprogramming/c_arrays.htm

 

https://web.facebook.com/qianjingg/videos/471417230173293/

 

 

C pointers

 

"Who knows how to work with pointers knows programming."

 

https://www.programiz.com/c-programming/c-pointers

 

https://www.tutorialspoint.com/cprogramming/c_pointers.htm

 

https://www.geeksforgeeks.org/pointers-c-examples/

 

https://www.holbertonschool.com/coding-resource-pointers-in-c

 

https://www.codewithc.com/understanding-c-pointers-beginners-guide/

 

https://www.learn-c.org/en/Pointers

 

https://www.learn-c.org/en/Pointer_Arithmetics

 

 

 

C matrices

 

https://en.wikipedia.org/wiki/Matrix_(mathematics)

http://www.maths.surrey.ac.uk/explore/emmaspages/option1.html

https://www.wikihow.com/Understand-the-Basics-of-Matrices

 

 Matrix calculator

https://matrixcalc.org/en/

 

https://www.mathsisfun.com/algebra/matrix-introduction.html

https://www.khanacademy.org/math/precalculus/x9e81a4f98389efdf:matrices/x9e81a4f98389efdf:mat-intro/a/intro-to-matrices

https://beginnersbook.com/2014/01/2d-arrays-in-c-example/

https://www.sanfoundry.com/c-programming-examples-matrix/

 

Accessing Matrix Elements by Using Array Name as a Pointer

http://ecomputernotes.com/what-is-c/function-a-pointer/accessing-matrix-elements

 

           

C structures

https://www.tutorialspoint.com/cprogramming/c_structures.htm

 

C linked lists

https://www.learn-c.org/en/Linked_lists

https://www.w3resource.com/c-programming-exercises/linked_list/index.php

https://www.tutorialspoint.com/learn_c_by_examples/linked_list_programs_in_c.htm

https://www.tutorialspoint.com/data_structures_algorithms/linked_list_program_in_c.htm

https://www.geeksforgeeks.org/linked-list-set-1-introduction/

 

Here are all inserting functions for node in linked list,

Add a node at the front

Add a node after a given node

Add a node at the end

and complete program that uses all of the above methods to create a linked list.

https://www.geeksforgeeks.org/linked-list-set-2-inserting-a-node/

 

. . .

 

After that learn object oriented languages like C++, Java, Python...

 

 C++

 

https://www.tutorialspoint.com/cplusplus/index.htm

https://www.w3schools.com/cpp/default.asp

https://www.w3resource.com/cpp-exercises/

 C++, free course

https://www.udemy.com/course/free-learn-c-tutorial-beginners/

 C++ best ebook in OOP C++, C++ Notes for Professionals book, 600 pages

https://books.goalkicker.com/CPlusPlusBook/CPlusPlusNotesForProfessionals.pdf

 

 Java 8

https://www.tutorialspoint.com/java8/index.htm

https://www.w3schools.com/java/default.asp

https://www.w3resource.com/java-exercises/

https://dev.to/javinpaul/101-coding-problems-and-few-tips-to-crack-your-next-programming-interviews-402a

 

 Java Script

https://www.tutorialspoint.com/javascript/index.htm

https://www.w3schools.com/js/default.asp

 

 Python

https://www.tutorialspoint.com/python/index.htm

https://www.w3schools.com/python/

https://www.w3resource.com/python-exercises/

 

 C#

https://www.tutorialspoint.com/csharp/index.htm

https://www.w3resource.com/csharp-exercises/

 

 HTML

https://www.tutorialspoint.com/html/index.htm

https://www.w3resource.com/html-css-exercise/index.php

 

 CSS

https://www.tutorialspoint.com/css/index.htm

https://www.w3resource.com/html-css-exercise/index.php

 CSS, great for different screen resolutions of the devices

https://www.w3schools.com/css/default.asp

https://www.tutorialspoint.com/css/css_responsive.htm

 W3.CSS

https://www.w3schools.com/w3css/default.asp

 Responsive Web Design

https://www.w3schools.com/css/css_rwd_intro.asp

 

 PHP

https://www.tutorialspoint.com/php/index.htm

https://www.w3schools.com/php/default.asp

https://www.w3resource.com/php-exercises/

 

. . .

 

You can find all my C programs at Dragan Milicev's pastebin:

 

https://pastebin.com/u/dmilicev

 

 https://www.facebook.com/dmilicev

 

-----------------------------------------------------------------------------

 

C++ linked lists

 

https://www.geeksforgeeks.org/data-structures/linked-list/

https://www.codesdope.com/blog/article/c-linked-lists-in-c-singly-linked-list/#:~:text=A%20linked%20list%20is%20made,connected%20to%20a%20different%20node

https://www.codementor.io/@codementorteam/a-comprehensive-guide-to-implementation-of-singly-linked-list-using-c_plus_plus-ondlm5azr

https://www.softwaretestinghelp.com/linked-list/

https://www.bitdegree.org/learn/linked-list-c-plus-plus

http://www.cplusplus.com/articles/LACRko23/

https://www.google.com/search?q=c%2B%2B+linked+list

 

-----------------------------------------------------------------------------

 

Graphic in C, C++, CodeBlocks:

 

Note also that initgraph() and the other graphic functions belonged to the ancient Turbo-C/C++ compilers for MS-DOS. Using those nowadays via WinBGIm is not the best choice to learn graphics programming.

 

Graphics-Library for C/C++ in CodeBlocks

 

How to use graphics in CodeBlocks?

 

https://www.google.com/search?q=how+to+use+graphics+in+codeblocks&rlz=1C1PRFC_enRS707RS707&oq=how+to+graphics+in+c+codebloks&aqs=chrome.2.69i57j0l5.27373j1j7&sourceid=chrome&ie=UTF-8

https://medium.com/@sagarganiga468/use-graphics-h-in-code-blocks-fe6ae3d8d4c2

https://github.com/SagarGaniga/Graphics-Library

https://codeload.github.com/SagarGaniga/Graphics-Library/zip/master

https://www.codeproject.com/Questions/1255636/Using-graphics-h-in-codeblocks

https://github.com/SagarGaniga/computer-graphics

 

Graphics-Library

Download required libraries from

https://github.com/SagarGaniga/Graphics-Library

 

It is a tradition to use Turbo C for graphic in C/CPP.

But it's also a pain in the neck.

 

Here we are using Code::Blocks IDE, which will ease out our work.

 

Steps to run graphic code in CodeBlocks

 

1. Install Code::Blocks

Make sure you have installed Code::Blocks IDE on your machine.

If you don't have this IDE or have any issue with compiler download and install it from here.

http://sourceforge.net/projects/codeblocks/

 

2. Download the required header files

We need few files to be included in the lib folder of Code::Blocks.

Download the files from here

https://github.com/SagarGaniga/Graphics-Library

 

3. Include graphics.h and winbgim.h

Copy and Paste the graphics.h and winbgim.h files into include folder of Code::Blocks directory.

Path: C:\Program Files (x86)\CodeBlocks\MinGW\include

 

4. Include libbgi.a

Copy and paste libbgi.a file in the lib folder of Code:Blocks

Path: C:\Program Files (x86)\CodeBlocks\MinGW\lib

 

5. Add Link Libraries in Linker Setting

In the Code::Blocks application go to, Settings > Compiler

In the Global Compiler setting, click on the Linker Settings

In Link Libraries, Add and browse to C:\Program Files (x86)\CodeBlocks\MinGW\lib\ and select libbgi.a.

Paste this in the Other Linker Option tab of Linker Settings (i.e. on the right-hand side)

-lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32

 

Save the setting and restart the application

 

To test the setting copy paste any computer graphics code from

https://github.com/SagarGaniga/computer-graphics

 

Note:

Save code in cpp extension !

 

Don’t forget to include graphics.h

 

Enjoy Computer Graphics :)

 

https://www.codeproject.com/Questions/1255636/Using-graphics-h-in-codeblocks

I am getting warning: Deprecated conversion from string constant to char Pass NULL

instead of an empty string. The reason you got this warning (it is a warning and

not an error) is that you pass a string literal which is const by definition

but the function parameter is not const (char *).

 

Note also that initgraph() and the other graphic functions belonged to the

ancient Turbo-C/C++ compilers for MS-DOS. Using those nowadays via WinBGIm is

not the best choice to learn graphics programming.

 

How can I add <graphic.h> directory in Dev C++? step by step ....just for newcomer

Jark Clim: Dont. Use a more updated graphics library. SDL2, SFML, FLTK are all available

Jark Clim: Graphic.h is meant to be used in a DOSBOX environment. It doesnt run natively

https://www.google.com/search?rlz=1C1VFKB_enRS696RS704&sxsrf=ACYBGNSyCjxfz3DrVv81R20uvGWAlxY3jA%3A1574168080370&ei=EObTXfnjEs6R8gKw9YaICQ&q=graphic+libary+SDL2+SFML+FLTK&oq=graphic+libary+SDL2+SFML+FLTK&gs_l=psy-ab.3...7638.25924..26511...0.0..0.168.531.0j4......0....1j2..gws-wiz.......0i19j0i13i30i19.OCD8b0ZAk4g&ved=0ahUKEwj5q_mJqfblAhXOiFwKHbC6AZEQ4dUDCAs&uact=5

 

-----------------------------------------------------------------------------

 

Here is example how to input only integer:

 

int number;

char terminator;

 

if( scanf("%d%c", &number, &terminator) != 2 || terminator != '\n' )

{

  printf("\n number = %d is not an integer ! \n");

  return(1);

}

 

C function scanf() returns number of successfully loaded values.

 

If there are 2 successfully loaded values,

scanf return 2 and that means

first one is integer because od %d

and second one is enter '\n'.

 

This is useful if we expect the user to enter an integer.

 

If he accidentally enter a letter,

the program crashes because of function scanf().

 

This is good way to awoid such problems.

 

-----------------------------------------------------------------------------

 

Nick DB Fletcher's comment that I like very much:

 

- Have a good idea of the kind of programs you'll want to create

 

- Don't EVER think that you can't do it or that it's too difficult, it isn't,

you just need to come at it from a different angle or learn something else

that will help you understand the bit you were having trouble with

 

- Learn the 'big picture'! Don't get focused on what a loop is, there are

references for that. If you learn the big picture, you will be able to pick up

new languages with less time and effort and your designs will be better

- Learn to think about programming as a problem solving exercise. When you're

reading a book or watching a tutorial video, don't wait for the explaination,

stop and have a go yourself. See what you can come up with. It's OK if you

can't get it right, the main thing is to get your brain active and get used to

putting what you've learnt into practice

 

- Write programs. Think of a tool that might help you to do something and code

it.

 

- You can't learn to play a musical instrument by reading about it, and it's

the same for programming. By making programs, your skill will improve, and

that's different to knowledge. Knowledge is great, but it won't help you to

write good programs.

 

- Have fun!

 

-----------------------------------------------------------------------------

 

Pointers

 

 

How to understand pointers?

I have a phone number from a guy

who has a phone number from a friend

who has a phone number from a professor who knows pointers well.

Here, the phone numbers are pointers.

 

https://www.facebook.com/sprdnjesaETFa/photos/a.420570328094001/1358919187592439/?type=3&theater&hc_location=ufi

 

"Who knows how to work with pointers knows programming."

 

"I am pointer, I hold address of other variable."

 

Pointers are crucial.

 

int array[10];

 

array == &array[0]

 

*array == array[0]

 

**x is a pointer to a pointer:

 

*x points to an address

 

**x is the value at that address.

 

 

https://www.programiz.com/c-programming/c-pointers

https://www.codewithc.com/understanding-c-pointers-beginners-guide/

https://www.tutorialspoint.com/cprogramming/c_pointers.htm

https://www.holbertonschool.com/coding-resource-pointers-in-c

 

Pointers are 4 or 8 bytes depending on architecture

(32-bit uses 4 byte, 64-bit uses 8 byte).

 

int variable=5;

 

int *pointer_to_variable = &variable;

 

pointer_to_variable ( bffd8b3c ) is memory address

where is stored value of variable ( where is stored 5 )

 

printf("\n variable = %d \n", variable );

 

Output is: 5

 

 

printf("\n variable = %d \n", *pointer_to_variable );

 

Output is: 5

 

 

printf("=n Address stored in pointer_to_variable: %x \n", pointer_to_variable );

 

Output is: bffd8b3c

 

 

pointer_to_variable means: address of variable, memory address ( bffd8b3c ) where is stored ( 5 ) .

 

*pointer_to_variable means: value of variable and it is 5

 

. . .

 

There are some explanations of pointers that I found on the web

 

https://www.google.com/search?q=best+explanation+for+pointers+in+C

 

. . .

 

Nick DB Fletcher:

https://web.facebook.com/nickeax

Lives in Melbourne, Victoria, Australia

 

An array of pointers is nothing more than what it says.

If you are unsure what a pointer is, learn that first and it will all make

sense.

Basically though, anything stored in RAM has a memory address. Usually, we use

symbols instead of the actual address number and we call those symbols

variables.

It's possible to find out the memory address of a variable and store that in

another variable. That variable is called a pointer, because it refers to the

location of a variable, or points to it.

You can use the pointer variable to find the value stored at the location it

refers to, by 'de-referencing' it. This means the pointer variable acts the

same as the original variable (which is really an atomatically de-referenced

pointer! ).

 

. . .

 

For explaining pointers I guess index in books is a good analogy.

 

We print extra few pages in every book even though it contains no actually

content

on the topic the book is written on, just to make navigating through the book

easier.

 

Pointers are exactly the same for computers. It contains no actual data we require

(just the memory address) still it occupies space, to remember where the actually stuff is.

 

You can consider each entry in index to be a pointer.

It point you to page number where the chapter starts.

 

. . .

 

A pointer is a variable that points to a location in memory. It contains a memory address.

You can give the pointer variable the address of another variable with the & notation, eg, ptr = &fred.

 

You dereference the pointer with the * notation, eg, *ptr.

 

Pointers are a way for variables to be passed to functions by reference rather than by value.

 

You can perform arithmetic on pointers, but you need to be aware !!! of what memory chunk size

you’re using when you add “1” to the pointer to get to the next memory location.

Admittedly, this can be tricky sometimes.

You can get very fancy with how you use pointers in more complex expressions

and this can be a source of confusion. It’s the nature of the beast, unfortunately,

and taming it only comes with experience.

 

. . .

 

Pointers are basically the same as any other variable. However, what is different about them

is that instead of containing actual data, they contain a address (pointer) to the memory location

where information can be found. This is a very important concept, and many programs and ideas

rely on pointers as the basis of their design, linked lists for example.

 

. . .

 

In simple words, a pointer is an address.

 

It is a derived data type that stores the memory address.

 

A pointer can also be used to refer another pointer, function.

 

A pointer can be incremented/ decremented, i.e., to point to the next/ previous memory location.

 

https://www.geeksforgeeks.org/pointers-c-examples/

 

. . .

 

-----------------------------------------------------------------------------

 

C recursive functions

 

https://www.w3resource.com/c-programming-exercises/recursion/index.php

https://www.includehelp.com/c-programs/recursion-examples.aspx

https://www.learn-c.org/en/Recursion

https://www.cprogramming.com/tutorial/c/lesson16.html

https://www.geeksforgeeks.org/recursion/

https://www.geeksforgeeks.org/recursive-functions/

https://www.google.com/search?q=c+recursive+funtions

 

-----------------------------------------------------------------------------

 

C - switch statement

 

https://www.tutorialspoint.com/cprogramming/switch_statement_in_c.htm

https://www.programiz.com/c-programming/c-switch-case-statement

https://www.geeksforgeeks.org/switch-statement-cc/

 

-----------------------------------------------------------------------------

 

If Else Statement in C Programming

 

https://www.knowprogram.com/c-programming/if-else-statement-in-c-programming/

 

-----------------------------------------------------------------------------

 

The problem with coding is that computers always do what you told them to do,

not what you wanted to tell them to do ...

 

The problem with programming is that the computer always does

what we told it to do, not what we wanted to tell it to do.

 

-----------------------------------------------------------------------------

 

 Secrets of C function printf

https://www.cypress.com/file/54441/download

 

 PRINTF - formatted output to standard output. (ANSI Standard)

https://www.thinkage.ca/gcos/expl/c/lib/printf.html

 

-----------------------------------------------------------------------------

Jark Clim:

In C++, using namespace std is poor programming practice because it throws

the whole concept of modularity via namespaces out the window.

-----------------------------------------------------------------------------

C arrays

 

C Array [106 exercises with solution]

https://www.w3resource.com/c-programming-exercises/array/index.php

https://www.tutorialspoint.com/cprogramming/c_arrays.htm

https://web.facebook.com/qianjingg/videos/471417230173293/

 

 lets_learn_c_arrays_of_int_v1.c

https://pastebin.com/a2qEUUPH

 

 array_sort_and_insert_elements.c

https://pastebin.com/78p8SR9t

 

 circular_movement_of_array_elements.c

https://pastebin.com/QWj233aK

 

 search_element_in_array.c

https://pastebin.com/dyANfctn

 

 merge_two_arrays_of_integers_v1.c

https://pastebin.com/rnrfbutC

 

 array_of_even_and_odd_integers_v1.c

https://pastebin.com/VrHTfS33

 

 reverse_array_of_integers_v1.c

https://pastebin.com/9LwRDmPU

 

 sorting array of integers v1.c

https://pastebin.com/q1RcZ1EW

 

 array of 10 integers v1.c

https://pastebin.com/hWFMWuVj

 

Matrix

 

 function_with_double_pointer.c

https://pastebin.com/sKtjkmXU

 

-----------------------------------------------------------------------------

There is no function like function getch() :)

getch is a non standard function, it is used to get a character without pressing enter key and it doesn't print the entered character in console screen.

That <without pressing the enter key> is especially important and that is why I say that there is no similar function that could replace it.

It is used to hold the output screen.

It is very convenient (in the sense that there is no replacement) to use it in the menu, when the user does not have to press key enter after pressing the key to select an item from the menu.

Without outdated

#include<conio.h>

we can use _getch() instead of getch().

Similar story has C function kbhit().

We can use _kbhit() instead.

BTW, does anyone know how to write implementation of function getch() and kbhit() but in modern code without conio.h?

I don't know how to do it :(

 

I'm looking for modern written functions getch and kbhit, without the old conio.h.

-----------------------------------------------------------------------------

 

Patterns:

 

Most important thing is to learn algorithms, programming logic.

First learn C patterns with loops.

 

 number_pattern_v1.c

https://pastebin.com/9L0u3pvx

 

 number patterns v1.c

https://pastebin.com/MLJ53BQG

 

 numbers_pattern_with_abs()_v1.c

https://pastebin.com/Hi3yNZ2T

 

 v_pattern_with_explanation_v1.c

https://pastebin.com/PV5R2Vh0

 

 char_patterns_v1.c

https://pastebin.com/393Xa6xm

 

 pattern with numbers v1.c

https://pastebin.com/7zAXwRu1

 

 simple star-o  pattern v2 .c

https://pastebin.com/wqPw7KTj

 

 simple star-o  pattern v1 .c

https://pastebin.com/u8G8bLZd

 

 pattern_challenge_v1.c

https://pastebin.com/YwzZeZmn

 

 diamond star pattern with number of rows v1 .c

https://pastebin.com/jQdjkxPG

 

 diamond star wall pattern with abs() and longest row v1.c

https://pastebin.com/dNigEQas

 

 pattern_of_3_triangles_in_a_square_v1.c

https://pastebin.com/HEAvtYty

 

 pattern_centre_v1.c

https://pastebin.com/7fBPS2Wf

 

 hollow rectangle pattern v1.c

https://pastebin.com/Rbyux4pP

 

 square pattern with cross v1.c

https://pastebin.com/NWjSG9yH

 

 number pattern 2 v1.c

https://pastebin.com/u6FucV06

 

https://www.faceprep.in/c/pattern-programs-in-c/

https://codedost.com/c/character-alphabet-patterns-c/

http://www.cprograms4future.com/p/alphabetical-pattern-programs.html

https://www.programiz.com/c-programming/examples/pyramid-pattern

http://cbasicprogram.blogspot.com/2013/03/alphabet-patterns.html

https://code4coding.com/c-program-to-display-alphabet-pattern/

https://www.techstudy.org/cLanguage/c-programs-to-print-alphabet-pattern

 

You can find all my C programs at Dragan Milicev's pastebin:

https://pastebin.com/u/dmilicev

 

-----------------------------------------------------------------------------

 

Arrays:

 

 lets_learn_c_arrays_of_int_v1.c

https://pastebin.com/a2qEUUPH

 

 array of 10 integers v1.c

https://pastebin.com/hWFMWuVj

 

 contiguous_subarrays_v1.c

https://pastebin.com/LuXXcJAY

 

 contiguous_subarrays_v2.c

https://pastebin.com/RaMTLRTg

 

 minimum_difference_in_array_of_unique_integers_v1.c

https://pastebin.com/P4CukHiF

 

 delete_all_duplicate_elements_from_array_v1.c

https://pastebin.com/jQStAsNs

 

 array_sort_and_insert_elements.c

https://pastebin.com/78p8SR9t

 

 circular_movement_of_array_elements.c

https://pastebin.com/QWj233aK

 

 search_element_in_array.c

https://pastebin.com/dyANfctn

 

 merge_two_arrays_of_integers_v1.c

https://pastebin.com/rnrfbutC

 

 array_of_even_and_odd_integers_v1.c

https://pastebin.com/VrHTfS33

 

 reverse_array_of_integers_v1.c

https://pastebin.com/9LwRDmPU

 

 sorting array of integers v1.c

https://pastebin.com/q1RcZ1EW

 

 bubble_sort_array_of_integers_without_pointers_v1.c

https://pastebin.com/r9GBEMXF

 

You can find all my C programs at Dragan Milicev's pastebin:

https://pastebin.com/u/dmilicev

 

-----------------------------------------------------------------------------

 

Matrices:

 

 lets_learn_c_matrices_with_integers_v1.c

https://pastebin.com/Lp5fr8T9

 

 matrix_max_sum__path.c

https://pastebin.com/PhwWrP3y

 

 determinant_of_square_nxn_matrix.c

https://pastebin.com/y9JYBcyn

 

 matrix_rotation.c

https://pastebin.com/2CFvx41T

 

 separation_of_matrix_elements.c

https://pastebin.com/7AbM4rB1

 

 a_way_to_access_matrix_elements.c

https://pastebin.com/rMXaiGYa

 

 rotation_of_matrix.c (on Serbian language)

https://pastebin.com/Njw6MKCK

 

 multiplication of matrices v1.c

https://pastebin.com/kT9cD8M1

 

 spiral_square_matrix_v1.c

https://pastebin.com/MezXECFM

 

 spiral_matrix_v1.c

https://pastebin.com/6mHVVYqz

 

 walk_through_the_matrix_with_arrow_keys_v1.c

https://pastebin.com/bep1ARVv

 

 matrix_connected_path_v1.c

https://pastebin.com/Ha5mVuKG

 

You can find all my C programs at Dragan Milicev's pastebin:

https://pastebin.com/u/dmilicev

 

-----------------------------------------------------------------------------