Go Back   Sat Universe > Off Topic > PC Section > Chat > Linux Chat

Note: Visitors from certain countries might see in-text advertising(underlind words in posts) or pop-under ads.
It is only shown to unregistered visitors or members that haven't made any posts. So you can easily get rid of it.

World-Of-Satellite

C programing

Linux Chat

Reply
  #1  
Old 14-07-2021, 05:31  Translate from English to Italian  Translate from English to French  Translate from English to German  Translate from English to Spanish  Translate from English to Dutch  Translate from English to Greek  Translate from English to Portuguese  Translate from English to Russian  Translate from English to Russian
cayoenrique cayoenrique is offline
Senior Member
 
Join Date: May 2018
Posts: 257
Thanks: 194
Thanked 526 Times in 154 Posts
Country: Country Flag
Default C programing

I been trying to motivate users to get involve in getting them self on solutions, instead of just asking for help. For example I started Encryption Learning at https://www.sat-universe.com/showthread.php?t=318003
At one point or another we will need to create programs. Now there are many languages. But I will focus in C. C is the basic language. It is been use everywhere. In fact Unix, Linux, Windows and Mac OS where initially develop in C. Not to forget the routers and Receives you used. In the future you may like to do Cuda or OpenCl they too use a basic form of C.

In general you use a PC and requires you to use a Text editor to write your programming. Then you need a Compiler. This compiler transform your human readable code in to an executable file. Well all tools and resources needed are combine in a development tool called IDE. Just as programs there many IDE. I strongly recommend one that can be use under any OS. The one I use is FREE and is called Codeblocks.

To install on any Debian OS is as simple as
Code:
sudo apt update
sudo apt install codeblocks
But best is for you to watch the process in youtube.

Compiling Your First C++ Program in CodeBlocks (Linux)
Code:
https://www.youtube.com/watch?v=Envlo4iH9sU
If you chose Windows try this one.
How to Install CodeBlocks ( IDE 20.03 ) with MinGW for C and C++ Programming on Windows 10
Code:
https://www.youtube.com/watch?v=GWJqsmitR2I

Now C Programing
Youtube have many channels. One I like and used to watch was

mybringback
Code:
https://www.youtube.com/c/mybringback
Learn C Programming Tutorial 1.1 Introduction
Code:
https://www.youtube.com/watch?v=QI7NZxZ4VsE&list=PL1D2BCBAABE5ED1A4&index=1
You learn at your own speed. I was teached to download the training's using youtube-dl or smtube. Then on my spare time even if I did not have internet I could watch and learn.

Hope it helps.
Reply With Quote
  #2  
Old 14-07-2021, 20:16  Translate from English to Italian  Translate from English to French  Translate from English to German  Translate from English to Spanish  Translate from English to Dutch  Translate from English to Greek  Translate from English to Portuguese  Translate from English to Russian  Translate from English to Russian
cayoenrique cayoenrique is offline
Senior Member
 
Join Date: May 2018
Posts: 257
Thanks: 194
Thanked 526 Times in 154 Posts
Country: Country Flag
Default

As I am to start my first programming lab I found that I mos to the first lesson any way with hellow word.

Code:
#: mkdir -p $HOME/cryptodir/Labs/006
#: cd $HOME/cryptodir/Labs/006
sudo apt update
sudo apt install codeblocks
Now to start codeblocks you can use your start menu or even type in your terminal codeblocks If it is your 1rst time you will see a window telling you about what compiler. Just leave it in GNU GCC.
Once up we click on [Create a new project] and in new windows select [Console Application].
Next Window click on C. Please notice not C++. And hit [Next].
Next Window type in Project title: csa_core
In folder use [***] to browse your working folder, mine is /enrique/cryptodir/Labs/006/
As you may notice the other 2 inputs are filed automatic with the info you just enter previously. So Hit [Next].
In this new window you do not need to do anything just leave compiler as GNU GCC Compiler.

As this is 1rst time lets to some arrangement.
Hit Maximize so that codeblocks use whole screen.
Now go and select Menu>View>Toolbars>Optimize toolbars
Finally lets add a check mark in Menu>View>Logs Your screen should look like this:
Click to enlarge

Lets do a quick description.
AT the top as most GUI programs we have the Menu and the Toolbar with short cuts.
Below on the left is the Management. At th moment it has 2 tabs. Projects and Resources. Leave it in Projects as it shows your files. You should see Workspace>csa_core>sources.
In the right up we have the editor, below it the Log window.

Now every time you create a project codeblocks will add a main.c with Hellow word sample project. Just basic skeleton to get you started. Lest edit it.
In the left the file structure have small black triangle. The top one point down meaning the are maximized. But Source is pointing Right. Lets click on the Sources black triangle. It will point down and maximize reveling main.c
Now Double Click on main.c and you should see in the right its content. It should look like

Click to enlarge

Now lets build and execute it. Click on Menu>Build>Run.
It will ask us if we what to build it 1rst. Click on [YES]

The program will build, you can see now that Log windows is in TAB Build Log and you should see
Code:
Output file is bin/Debug/csa_core with size 18.63 KB
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
And an output terminal should open showing you any output the program does. In this case you see it prints Hellow world!.
But to allow you to read its output the program at the end waits for you to hit [Enter]. Hit Enter and the windows closes. This is how it looks
Click to enlarge

To & quit you just do
Menu>File>Save Workspace
Menu>File>Quit.

If you do just Quit it should as you if you want to save any unsaved file.
Reply With Quote
The Following User Says Thank You to cayoenrique For This Useful Post:
dijitalxyz (04-08-2021)
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:22.


Powered by vBulletin
Copyright ©2006-2019 - Sat Universe