harmony5 🇺🇳 ⌤
i need help
If it's related to cpp, you can ask here in the group
aronCrow
i need help
So nice to hear that
Solenskee
i need help
With what
Danya🔥
Is this group still alive?
klimi
Is this group still alive?
no, totally dead, twice dead actually
Never Spam Bot
Danya🔥 is now approved by the group admin and can send messages without any restrictions To call a function written in C++ from C, you need to use the extern "C" linkage specification in C++. This tells the C++ compiler to use C linkage for the specified function(s), which prevents the compiler from mangling the function names (a common practice in C++ to support function overloading). Here’s how you can do it: ### Step 1: Declare the C++ Function with extern "C" In your C++ code, you declare the function you want to call from C with extern "C" to specify that the function has C linkage. This is often done within an extern "C" block, which allows multiple functions to be specified. You should also ensure that this block is only processed when compiling with C++, as C does not understand extern "C". C++ side (mycppcode.cpp and mycppcode.h): // mycppcode.h #ifdef __cplusplus extern "C" { #endif void myCppFunction(); // Declare the function you want to call from C #ifdef __cplusplus } #endif // mycppcode.cpp #include "mycppcode.h" void myCppFunction() { // Implementation of the function } ### Step 2: Call the C++ Function from C On the C side, you include the header file where the function is declared and call it as you would with any other C function. C side (myccode.c): #include "mycppcode.h" // Include the C++ header with the function declaration int main() { myCppFunction(); // Call the C++ function return 0; } ### Step 3: Compile and Link When compiling and linking, ensure that the C++ compiler knows to compile the C++ code and the C compiler to compile the C code. Then, link them together. For example, using GCC: 1. Compile the C++ code to an object file: g++ -c mycppcode.cpp -o mycppcode.o 2. Compile the C code to an object file: gcc -c myccode.c -o myccode.o 3. Link the object files together into an executable: g++ myccode.o mycppcode.o -o myprogram In the linking step, use the C++ compiler (g++) to ensure the C++ standard library is linked correctly, especially if your C++ code requires it. This process allows you.. See spam? Quote the spam message in the group and reply with /spam
Danya🔥
Danya🔥 is now approved by the group admin and can send messages without any restrictions To call a function written in C++ from C, you need to use the extern "C" linkage specification in C++. This tells the C++ compiler to use C linkage for the specified function(s), which prevents the compiler from mangling the function names (a common practice in C++ to support function overloading). Here’s how you can do it: ### Step 1: Declare the C++ Function with extern "C" In your C++ code, you declare the function you want to call from C with extern "C" to specify that the function has C linkage. This is often done within an extern "C" block, which allows multiple functions to be specified. You should also ensure that this block is only processed when compiling with C++, as C does not understand extern "C". C++ side (mycppcode.cpp and mycppcode.h): // mycppcode.h #ifdef __cplusplus extern "C" { #endif void myCppFunction(); // Declare the function you want to call from C #ifdef __cplusplus } #endif // mycppcode.cpp #include "mycppcode.h" void myCppFunction() { // Implementation of the function } ### Step 2: Call the C++ Function from C On the C side, you include the header file where the function is declared and call it as you would with any other C function. C side (myccode.c): #include "mycppcode.h" // Include the C++ header with the function declaration int main() { myCppFunction(); // Call the C++ function return 0; } ### Step 3: Compile and Link When compiling and linking, ensure that the C++ compiler knows to compile the C++ code and the C compiler to compile the C code. Then, link them together. For example, using GCC: 1. Compile the C++ code to an object file: g++ -c mycppcode.cpp -o mycppcode.o 2. Compile the C code to an object file: gcc -c myccode.c -o myccode.o 3. Link the object files together into an executable: g++ myccode.o mycppcode.o -o myprogram In the linking step, use the C++ compiler (g++) to ensure the C++ standard library is linked correctly, especially if your C++ code requires it. This process allows you.. See spam? Quote the spam message in the group and reply with /spam
Lmao
Dima
How so?
welcome back
Danya🔥
welcome back
Why didn't you deploy an LLM here?
Ivan
Why didn't you deploy an LLM here?
I am an LLM, questions?
Danya🔥
I am an LLM, questions?
You're a Belarusian brother
Danya🔥
🤍❤️🤍
No бчб please
Brian
What's the best stack {combination of languages and or frameworks}to go with with c++ ?
Ivan
What's the best stack {combination of languages and or frameworks}to go with with c++ ?
Short answer: it depends. Long answer: you can only determine it seeing an exact goal. Are you doing gamedev? Backend? Frontend? OSDev? Whatever that you are doing, just Google "C++ <your field> best guides" or something like that and research for a bit. As soon as you have more exact questions, come here again and ask them.
ɢᴀɢᴀɴ
Build a program using call by value and call by reference. In C anyone help me i clg test tomorrow
Ighor
How so?
If you exit the group and rejoin, the bot erases its memory about you, so it tests your messages again
Orange Juice
Mhm how many C coders here?
Ludovic 'Archivist'
Mhm how many C coders here?
at least 6000, why would you ask this
Orange Juice
So that would imply there are 12000 C++ Coders
Orange Juice
Interesting
Ludovic 'Archivist'
So that would imply there are 12000 C++ Coders
Nah, most C++ devs are also C devs, just not every one in there is active on their Telegram account
Orange Juice
Interesting
𝘞𝘦𝘢𝘳𝘪𝘯𝘨𝘔𝘦𝘥𝘢𝘭
Ludovic 'Archivist'
12000 are chinese spies
Says the Russian spy
Orange Juice
Why is math blocked
Vlad
Why is math blocked
Math is considered heresy these places
Vlad
Or smth
Orange Juice
Explains why everyone hating on the 12,000
Vlad
No meth math
Orange Juice
oops
Rose
Heya :) PM me if you have any questions on how to use me!
Ocean
Большею частию все народ робкий, а известно - просители;)
Ocean
Says the Russian spy
Glad seeing you being energetic and being around;) although the group probably has become “stillwater”, I hope you are not affected at all and I hope that you are enjoying more things than before. (Although I don’t really know what the groups were like before)… Anyway, I don’t know if all groups on telegram have kinda already lost a connection to people’s struggle either to technical problems or other things, but I wish there will be a new, refreshing way for people to connect, maybe even towards a better direction 👏
Ocean
Here I toast, to the better future of all human beings
Rose
User Deric V Senpai has 1/2 warnings; be careful! Reason: ad
Rose
User Fan of has 1/2 warnings; be careful! Reason: ad
Ivan
Nah, most C++ devs are also C devs, just not every one in there is active on their Telegram account
Well... I mean, I wouldn't be any efficient writing C unike with C++. Imo C++ and C are substantilly different at this point
Ocean
English please
Hi there! I'm just wondering if the language of visual basic, in any possible way, belongs to the C family? And as for the Russian sentence I wrote before, it is more of a reply to the disappointment in the "missing" of vigor in groups: that everyone feels shy one way or another, but the most famous case should be those who ask questions or for help. I think that might also be the reason that people don't want to show up here: they feel shy asking real people, especially with the existence of AI assistant nowadays. Many people would say: only ask me questions after you have "fed it" to all of the following things: google, AI and... (as for the last one I couldn't really recall but you got the idea;)
Ocean
This language feels not used anymore, at least it's not popular or making people feel cool about it in any way:(
Ocean
Definitively no. BASIC (a language which VB is derived from) appeared in 1964, while C - in 1972
Thanks for the interesting information here... The only thing I know about it is that it has been used more than 20 years. But didn't know that it came out way earlier than even C
Ludovic 'Archivist'
Hi there! I'm just wondering if the language of visual basic, in any possible way, belongs to the C family? And as for the Russian sentence I wrote before, it is more of a reply to the disappointment in the "missing" of vigor in groups: that everyone feels shy one way or another, but the most famous case should be those who ask questions or for help. I think that might also be the reason that people don't want to show up here: they feel shy asking real people, especially with the existence of AI assistant nowadays. Many people would say: only ask me questions after you have "fed it" to all of the following things: google, AI and... (as for the last one I couldn't really recall but you got the idea;)
Hey, here it is less of a lack of vigor and more of trying to stay matter of factly in the on topic BASIC is not a language of the C family, it is its own slightly older family of languages. Yes, there is some (reasonable) expectation you tried to understand your problem alone, it has nothing to do with AI, unless you think it was any different 20 years ago (in which case you are welcome to time travel there and check for yourself, but http://www.catb.org/esr/faqs/smart-questions.html had its first version in 2001) I honestly think that AI should be the last recourse to solve a problem, after people, but google, forums and experimentation should indeed come before going to other people
Ocean
I do know some VB.NET just because I am PLT enthusiast
You might like this to be the wallpaper for your phone? https://paste.pics/TBGDC Lol it’s just a carefree sharing to the enthusiasts of C/C++ here, hope I’m not being off-topic? ()
/MubarakOlamide
Hello everyone , I'm a beginner in C programming language. Can I get some recommendations 🤲?
Ludovic 'Archivist'
Hello everyone , I'm a beginner in C programming language. Can I get some recommendations 🤲?
Go and use Raylib and make a small version of Snake to get a feel for the language, then try and refine it to make it cleaner and easier to read. When you are done, reimplement it like you feel you should have done, then when you get disillusioned go and reimplement it again the right way
Ludovic 'Archivist'
The debugging hell is entirely unrelated to C or C++ and entirely related to Forth
Ludovic 'Archivist'
So many problems can be instantly solved by just using an object pool and not using inheritance
/MubarakOlamide
I’d say go for C++.
Is C++ can also be used for hardware programming
Ludovic 'Archivist'
Is C++ can also be used for hardware programming
Do you really mean hardware programming (as in FPGA programming) or embedded programming (as in microcontroller programming) ? C++ cannot do hardware programming but it can do embedded programming, operating systems programming, systems programming and game programming quite easily, web programming too with some difficulties
Abbasi
I thought you mean embedded. And then yes.
Abbasi
There're very good features in modern C++ that make it much more appropriate than C.
Abbasi
Smaller binary size, more performant, less error prone, high readability/maintainability and more.
Abbasi
@b_aaz What are you laughing at? 😄
B
@b_aaz What are you laughing at? 😄
Very bold of you to claim smaller binary size, high readability, maintainability and performance as attributes of C++ when compared to C .
Abbasi
There're good features like below in modern C++: constexpr variables and functions ... if constexpr / if consteval consteval functions concepts/requires templates And more These can help with this. If you're interested into having a more detailed explanation, let me know and I'll give you a thesis (which is kind of a book) and elaborate on these. The author also make accurate measurements to demonstrate the claims
Ocean
Oh it got destroyed by pastepics
Yes… seems that pastepics compresses images’ quality to a sadly noticeable degree. Maybe Postimg has a better way dealing with that: https://postimg.cc/QFrNV9Kc
B
There're good features like below in modern C++: constexpr variables and functions ... if constexpr / if consteval consteval functions concepts/requires templates And more These can help with this. If you're interested into having a more detailed explanation, let me know and I'll give you a thesis (which is kind of a book) and elaborate on these. The author also make accurate measurements to demonstrate the claims
Yeah templates help with readability 🤣 . All those things you mentioned also generally increase binary sizes by inlining more code. A thesis is not a "kind of a book". None of the points you mention also point to C++ having "higher performance", whatever that is, compared to C. So yeah please give me a more detailed explanation.