Владислав
(closed)
Viking
Are still some c++ jobs around by 2025? It looks like classic c++ jobs already dead or dying.
Rain Bow
Hi anyone can share EC/TDS sensor library for proteus?
Never Spam Bot
@Kau_01sar sent multiple messages that looks like a spam. If they send more spam - like messages, they will be muted. Only admins can unmute them. Total spam messages deleted in this group: 64
Danya🔥
Most of the programs you use nowadays are either written in or powered by C++ or C Such as browsers, search engines, compilers and runtimes, games
Priyanka
Hiiii
Андрій
Blane-Odysseus
What is the best C comp by benchmarks for linux?
Suka
What is the best C comp by benchmarks for linux?
tcc perhaps. https://github.com/TinyCC/tinycc
Ziky
tcc perhaps. https://github.com/TinyCC/tinycc
Does it make sense to use obscure compiler on desktop?
Simple Sorcerer
Hi all. How to get the pid of a locally connected unix socket from a local application?
Chat Boss
Simple Sorcerer sent a code, it has been re-uploaded as a file
Simple Sorcerer
This is roughly what I am doing. the socket of course works fine and accepts local unix socket connections
Simple Sorcerer
I have an error with the "ancillary data" setting everything else works fine. i can't understand the documentation again
Danya🔥
Simple Sorcerer sent a code, it has been re-uploaded as a file
To receive credentials such as the PID, UID, and GID from a UNIX domain socket, you need to set up your socket and message structures properly. The credentials are passed as ancillary data in the control message of the recvmsg() system call. Here are some common issues and solutions to consider: Common Issues & Fixes: 1. Ensure `SO_PASSCRED` is Set on the Socket: You've correctly enabled SO_PASSCRED on the socket, which is necessary to receive the credentials. 2. Setting up `struct msghdr`: The struct msghdr needs to be correctly set up to receive ancillary data. It looks like you are not setting up all required fields (`msg_name`, msg_namelen, msg_iov, msg_iovlen, msg_control, msg_controllen, `msg_flags`). 3. Setting up Ancillary Data Buffer Correctly: The buffer for ancillary data (`cmsg`) must be sufficiently large to hold the control message header plus the actual data (`struct ucred`). You're currently only allocating space for struct cmsghdr, which isn't enough. 4. Check for Proper Use of `recvmsg()`: The way you're checking the return value of recvmsg() is incorrect. You should check if it returns -1 for an error. Also, SCM_CREDENTIALS is not a flag for recvmsg(), it's used with the control message. Here's how you can correct these issues: // Set up the buffer for receiving the credentials struct ucred cred; char buf[BUFSIZ]; // adjust size as needed struct iovec iov = { .iov_base = buf, .iov_len = sizeof(buf) }; struct msghdr msg = {0}; char control[CMSG_SPACE(sizeof(cred))] = {0}; // reserve space for ancillary data msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = control; msg.msg_controllen = sizeof(control); ssize_t nbytes = recvmsg(new_sock, &msg, 0); if (nbytes < 0) { perror("recvmsg"); } else { for (struct cmsghdr *cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; cmsg = CMSG_NXTHDR(&msg, cmsg)) { if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_CREDENTIALS) { memcpy(&cred, CMSG_DATA(cmsg), sizeof(cred)); printf("PID: %d, UID: %d, GID: %d\n", cred.pid, cred.uid, cred.gid); break; } } } // ... close(new_sock); Additional Notes: - Ensure you include the necessary headers (`<sys/types.h>`, <sys/socket.h>, <sys/uio.h>, etc.). - The control message is aligned to the nearest size required by the system, so it's essential to use macros like CMSG_SPACE for allocating the control buffer. - The buffer buf in the iov structure is used to receive the primary data over the socket. If your protocol involves sending/receiving primary data before/along with the credentials, make sure to handle this data appropriately. - Error checking is crucial. Make sure to check the return values of each call and handle errors as needed.
Danya🔥
This is what ChatGPT has to say
Simple Sorcerer
I can't get anything to work. now I've completely broken my code :D
Blane-Odysseus
Guys why so many people quit programming while it is one of the most exciting activity and most paid skill in way of mastering.
MᏫᎻᎯᎷᎷᎬᎠ
How on earth can someone understand cppreference I spend a lot of time rereading paragraphs and words and it feels so stupid and frustrating
Ludovic 'Archivist'
How on earth can someone understand cppreference I spend a lot of time rereading paragraphs and words and it feels so stupid and frustrating
Some bits of the language absolutely are complicated and use specific vocabulary, but I want to say that you'd better get accustomed to not knowing things because upon starting to work in a company, you will be pretty confused by their ecosystem
M͓̽ ͓̽a͓̽n͓̽k͓̽ ͓̽I͓̽N͓̽D͓̽
Hey darling I want "application development with qt creator 3th edition" ebook Can anyone send it to me?
M͓̽ ͓̽a͓̽n͓̽k͓̽ ͓̽I͓̽N͓̽D͓̽
Emperor
Hi guys It’s nice to be here
klimi
Hi guys It’s nice to be here
please read the rules
Emperor
Don
klimi
mohamad
Hello
mohamad
I study advanced C++ language. Can someone send me a sample of lessons?
Ndurh
What website can i use to type c++ code and see results
klimi
?
Dima
@Huaabao2 reply to this message if you are not a bot
Blane-Odysseus
Guys what do u think which is better combination for success: math + programming or physics + programming? Learning three of these things for getting the best result is unrealistic imo.
Blane-Odysseus
Or just trying to focus more on one thing (programming)?
Blane-Odysseus
I believe master physics is irrelevant for software than math. Let's keeping hardware industry on China. 😂
Simple Sorcerer
Mohamed Hameem
Maths
Anonymous
Hi
MᏫᎻᎯᎷᎷᎬᎠ
Does someone has a link or good explanation of forwarding references and references collapsing These topics seems really confusing, I even recalled that type of confusion when a beginners tries to grasp pointers
MᏫᎻᎯᎷᎷᎬᎠ
I remember reading that book when I was a novice to intermediate level It was a frustrating and terrible experiment
Jhinga_Man
Can we find rref of a 2d array in c ?
Manav
Can we find rref of a 2d array in c ?
Can you explain more clearly what you want?
Jhinga_Man
Reduced row echolon form in c
Manav
Reduced row echolon form in c
I see why you need to deal with 2d arrays, so what's the issue?
Jhinga_Man
I see why you need to deal with 2d arrays, so what's the issue?
Could you give me a starting idea or basic logic on how I can find rref
Jhinga_Man
I see why you need to deal with 2d arrays, so what's the issue?
I could not find a good algo on google and chatgpt is also giving a wrong code 🥲
Manav
Could you give me a starting idea or basic logic on how I can find rref
Reference in what context? Share your code, your question is incomplete. Do you want to modify the 2d array in place? Where are you accessing this 2d array? Are you passing it in a function?
G U R U
int array[5]; array[5] = 88; sizeof(array) > 20bytes printf("%d",array[5]) -> 88; Allocated memory 20 bytes but after add array[5] = stored in array and also accessible
Chat Boss
Ziky the Red fox sent a code, it has been re-uploaded as a file
Anonymous
How do I convert a decimal number to its ASCII table value?
\Device\NUL
How do I convert a decimal number to its ASCII table value?
Just print using putchar() or %c format specifier. Or casting it to (char)
Elfa Metesar
i was reading 🙄rude
Simple Sorcerer
How do I convert a decimal number to its ASCII table value?
To avoid such questions, you should familiarize yourself with the character code. A Wikipedia page is enough for this.
Literally
Hey
Literally
can someone help me please? i'm making a C++ dll for roblox it works but i don't know how to make it execute loadstrings
Literally
what's h4x0r?
Literally
if u think u can help me come in private message
Manav
what's h4x0r?
Why are you trying to use loadstrings?
Literally
oh cause if
Literally
a script is like really long you know
Chat Boss
Keep Cream sent a huge message, it has been re-uploaded as a file i tried this std::string replaceAll(std::string subject, const std::string& search, const std::s..
Literally
i tried that but didnt work that well
Literally
can you help me pls bro? i will send u my full script
Literally
my full file and stuff