Cafè Linux – Telegram
Cafè Linux
580 subscribers
14 photos
5 videos
31 files
31 links
👾 ( Cafe Linux - C, Linux, BASH and so on )

🎥 YT: https://www.youtube.com/@TheLinuxCafe

( "The quieter you become, the more you are able to hear" )

Buy me a Coffee : { 0xbc8e52af7b46461b8076085Be771F465E26A9Dfd } - BEP20/USDT

whoami: @firstTarokh
Download Telegram
https://github.com/Tarokh-Yaghoubi/learning_c.git

Every thing you need to study about C programming is here!
Good Luck!

اینو از پارسال شروع کردم نوشتم
از صفر تا جایی که الان رسیده
مباحث C کاور شده . اسم دایرکتوری ها هم واضح هست. مثال هست با کامنت هایی که نوشته شده و توضیح داده شده خیلی چیزها

کم کم داره بهش اضافه میشه
مباحثی مثل threading و atomics
تا هفته دیگه اینا هم اضافه میشن و کاور میشن.
10
_Bool in C 👨‍💻

Do we have BOOL in C ?

We do have! and it is widely used in modern embedded projects for better readability, btw many low-level codes still use 0/1 instead of BOOL due to older compiler support, or coding standards.


Since C99:


#include <stdbool.h>

bool flag = false;
if (!flag) {...}

bool is a MACRO for _Bool

You can also use _Bool like this:



_Bool flag = false;


#cprogramming #notes #boolean @tcafeLinux
Please open Telegram to view this post
VIEW IN TELEGRAM
5❤‍🔥21
Cafè Linux
از چنل راضی هستید یا نه ؟ -.+
دوستان اینو لطفاً انجام بدید 🔥
Please open Telegram to view this post
VIEW IN TELEGRAM
❤‍🔥3
Quiz Time... 🔂
Please open Telegram to view this post
VIEW IN TELEGRAM
3
#include <stdio.h>

int main() {
int arr[] = {10, 20, 30, 40};
int *p = arr;
*(p + 2) = *(p + 1) + 5;
printf("%d\n", arr[2]);
return 0;
}

#include <stdio.h>

int main() {
int x = 5, y = 10;
int *p = &x, *q = &y;
*p = *q;
*q = *p + 2;
printf("%d %d\n", x, y);
return 0;
}
❤‍🔥2
#include <stdio.h>

int main() {
char str[] = "Hello";
char *p = str;
*(p + 1) = 'a';
printf("%s\n", str);
return 0;
}
bgipc_usl_c_1.pdf
337.1 KB
Unix Interprocess Communication
A brief introduction to unix programming and IPC.

#BEEJ #CPROGRAMMING @TCAFELINUX
👩‍🚀 👩‍🚀 😈
Please open Telegram to view this post
VIEW IN TELEGRAM
10🗿11
🗿. ری اکشن رو کمتر کنید 🗿
Please open Telegram to view this post
VIEW IN TELEGRAM
🤝12🗿7
Electronics_for_Dummies_Gordon_McComb,_Earl_Boysen_Z_Library.pdf
19.3 MB
Electronics for Dummies
- Gordon McComb

Getting started with Electronics from scratch.

#electronics #cprogramming #embedded @TCAFELINUX

👨‍💻 📱 🥺
Please open Telegram to view this post
VIEW IN TELEGRAM
❤‍🔥4💔1🗿1
Cafè Linux
از چنل راضی هستید یا نه ؟ -.+
اینو همینجا می‌بندم،

اون دوستانی که زدن ( نه ) یا ( می‌تونه بهتر بشه ) اگر
( حال کردن ) میتونن دلیلشون رو بنویسن که به بهتر شدن کانال کمک کرده باشن

😈🚀
Please open Telegram to view this post
VIEW IN TELEGRAM
🌻 ادمین مریض شده ناجور.

💙 یه ویدیو فارسی دارم رکورد میکنم برای کل سرفصل های سی، سه چهار ساعت درمیاد، که دیگه اپیزود اپیزود نشه سردرد نگیریم. ( بزودی میزارمش )

اون دوره انگلیسی هم ادامه میدیم تموم میکنیم ، بعدش وارد مباحث حرفه ای تر میشیم که قراره خوشتون بیاد
#notice #cprogramming
Please open Telegram to view this post
VIEW IN TELEGRAM
❤‍🔥10
- A NOTE on Threading in Linux -

⭕️⭕️⭕️⭕️⭕️⭕️⭕️

Regarding "threads are actually processes" in Linux:


This is referring to Linux's specific implementation detail. Most operating systems implement threads and processes as fundamentally different entities at the kernel level. But Linux takes a different approach:

In the Linux kernel, there's really only one type of execution unit - what it calls a "task"
When you create a process, you get a task
When you create a thread, you also get a task - but this task shares certain resources (like memory space, file denoscriptors, etc.) with the parent task
The kernel doesn't distinguish between "threads" and "processes" - it just sees tasks with different levels of resource sharing

So when you call pthread_create() to make a thread, Linux internally calls clone() (similar to fork()) but with flags that specify which resources should be shared between the parent and child tasks. A "thread" is just a task that shares most resources with its parent, while a "process" is a task that has its own separate resources.

This is why if you run ps -eLf on Linux, you'll see individual entries for each thread - because to the kernel, they're just separate tasks that happen to share memory.

#notes #threading #linux #cprogramming 💻👨‍💻 @TCAFELINUX
Please open Telegram to view this post
VIEW IN TELEGRAM
3👌211