Anonymous
I'm completely new to C/C++, now I'm learning how to install packages via Microsoft's package manager and Cmake. I used to code in VSC, but now I realised that I need something more complicated
Anonymous
What you mean by more complicated?
It is generally more suitable for C++ development
Ziky
Well i know people working on linux kernel using vim...
Danya🔥
It is generally more suitable for C++ development
More suitable doesn't mean more complicated
DaviChan
https://t.me/cpp20programming/190
KDevelop is another good one. Very good cmake support/integration
Sachin
Thanks for inviting me 😊
ynwqmv
i have tcp server witten in asio, so i need javascript websocket lib to communicate with server? Anyone knows?
DaviChan
It is unstable af tho
where did you run it on? I didn't have many problems so far. Been using it for around 2 years. Not as the main IDE though, only for side projects
DaviChan
its around the same experience as visual studio for me in terms of stability. But sure, no full fledged IDE i ever tried was rock solid
Skarn
It was Manjaro iirc
klimi
It was Manjaro iirc
(it could be manjaro's fault that it wasn't stable maybe)
Ingvar
Hello! I am making a server application.I have a server class and a "client handler" class. The server runs in a thread, and creates and a client handler for each connected client, which runs in a separate thread.When a client sends a message to the "client handler" on the server, I want the server to process the message and send it to all clients. I am thinking a callback funciton on the server can handle this, but this creates an "include" deadlock. What is the best way to handle this? Any suggestions?
Ingvar
yes
Might be a good idea :) I was thinking to have a call-back function on the Server object, and solved this in C with "extern", but in C++, extern cannot be used on a class...
Danya🔥
1. No private messages 2. Format your code with monospace font using Telegram features (right click) 3. Include the problem statement in the message
Danya🔥
You could've just edit the message, but ok
Anonymous
I'm learning C++ through the site "www.learncpp.com" do you recommend learning / reading something parallel to this material, it's the first time I get a programming language to learn DEFINITELY, I'll only change languages after I've done a lot of things lol, I played around with GO, but nothing too serious, I accept suggestions.
AlanCcE
Hi guys, just wondering Which IDE do you use to program in C/C++?
Anonymous
Hi guys, just wondering Which IDE do you use to program in C/C++?
There are 16900 people in this group. Do you really want to know what IDE each one uses? It will just result in spamming. Just use an IDE that you are comfortable with and stick to C/C++ questions alone in this group please To know the list of popular IDEs/Editors in use check this post: https://t.me/cpp20programming/190
Michel
Hi there, is there a way of initializing a std::queue with a pre-allocated capacity?
Michel
No. Use a deque instead if you must do this.
Could you give me an example? I've been tinkering with the documentation but I can't do it.
Anonymous
Could you give me an example? I've been tinkering with the documentation but I can't do it.
Deque supports everything that a queue can do. A std::queue is just an adaptor interface for an existing container like deque (or std::list). The push method of queue will call push_back on the underlying deque. The pop method on queue will call pop_front on the underlying deque.
Ya deway
Hello guys... I have some problems with the printf output of a http packet. The packet Is a pointer with type Unsigned Char like this: const Unsigned Char* packet = pcap_next().... For the output i use a function that take Two param: sizeof(packet) and packet, then i using a for loop so i can print Char by Char until i reach the end: "printf("%c", packet[i])" I can see the full packet but sometime the Shell print a bugged Char only at start position. Sorry for bad explanation Edit: on some sites i get at the end of print this strange code: 0Q0OM0K0 + Im sure about the length of packet, im working only on http payload (full packet size + layereth + layer_ip + ip_options + layer_tcp + tcp_option, that give me a correct pointer to payload only) so i think Is readable without problem
Ya deway
Are you sure you are getting reply in ascii? Not in different enconding?
It is very strange because the http payload I can print it completely, but during testing I tried several web servers and I noticed that in some at the time of printing, the first characters are displayed as if the bytes it reads are badly cut or not have to do with the payload. Now I try to print the payload in hexadecimal and try to convert it with an online hex to ASCII converter, so I understand if I did something wrong in calculating the length, even if I don't think so
Chat Boss
Leumim Camuenga sent a huge message, it has been re-uploaded as a file Hi, everyone! I have an exercise that says "Make a program to read two whole values and call a ..
Anonymous
Leumim Camuenga sent a huge message, it has been re-uploaded as a file Hi, everyone! I have an exercise that says "Make a program to read two whole values and call a ..
Both are equivalent. However in C++, references are preferred over pointers as a general practice. Some people do advice using pointers, to make it clear to the calling code, that the argument may be modified but this is not considered a sound advice by many. As far as the program behavior or speed is concerned, there is no difference between the two.
Anonymous
Message from Alexandr: Hi! I learn value categories in c++ and try to go deep for better understanding. Please help me with this code: https://gist.github.com/ExOLiNe/582a211efc05db66b06074906ccfae71 I dont understand why there is copy constructor call because for me it is very obvious that compiler can pass value from this reference to func2 without copying like if i do "func2(func(a))". I know that i can change func2 signature to func2(A&& s) and then call it with std::move(b) but it is means that not only me as caller responsible for lifetime of rvalue but creator of func2 as well. Why is this so?
Alexandr
It is lvalue even if it does not keep data on storage? 🤔
Anonymous
It is lvalue even if it does not keep data on storage? 🤔
A named object (even a rvalue reference like b in your case) is always a lvalue because it can be referenced from other parts of your program. Anything with a name is always a lvalue. The exceptions are : enumerators are rvalues though they have a name. Class, namespace and class template have names, but aren't values.
Alexandr
Ok, i see, thx.
Alexandr
It works without func2 signature "A&& s", just only with std::move(b) if i implement move constructor btw
Anonymous
It works without func2 signature "A&& s", just only with std::move(b) if i implement move constructor btw
std::move casts a lvalue reference to a rvalue reference. So obviously it will work.
Sksksks
Are there any c++ discord servers, telegram channels for daily c++ questions??
Ingvar
What is the best storage container for serial input buffer which could contain either binary or ascii (with or without characters with ascii code 1 to 31)?
Guillermo
vector<uint8_t> ?
Guillermo
Or maybe std::deque
Delious
hi guys
Delious
how can i become pro in c++; i just know the basics
Danya🔥
how can i become pro in c++; i just know the basics
Becoming a pro in C++ requires practice, dedication, and a willingness to learn new things. Here are some steps you can take to improve your C++ skills: Read C++ books: One of the best ways to improve your C++ skills is to read books written by experts in the field. Some recommended books include "C++ Primer" by Stanley Lippman, Josée Lajoie, and Barbara E. Moo (updated for C++11), and "Programming: Principles and Practice Using C++" by Bjarne Stroustrup (2nd Edition - May 25, 2014, updated for C++11/C++14). These books provide a comprehensive introduction to C++ that covers just about everything in the language in great detail. Practice coding: The best way to improve your C++ skills is to write code. Start by solving small problems and gradually move to more complex ones. You can practice on online platforms like LeetCode, HackerRank, and Codeforces, which provide a range of problems of varying difficulty. Try to write clean, well-structured code that follows best practices like commenting, naming conventions, and avoiding global variables. Read documentation: There are many libraries and frameworks available for C++, and reading their documentation can help you gain a deeper understanding of how they work. For example, you can read the C++ standard library documentation or the Boost C++ libraries documentation. Participate in online communities: Join online forums and communities where C++ programmers gather to share knowledge and ask for help. This will allow you to learn from others and get feedback on your code. For example, you can join the C++ community on Reddit or the C++ Slack community. Build projects: Try building some projects on your own, such as a game or a utility program. This will give you an opportunity to apply your C++ skills in a practical setting and help you learn new things. Start with a small project, and then gradually move to more complex ones. For example, you can build a text-based adventure game or a calculator app using C++. Watch C++ conferences: Attend or watch C++ conferences like CppCon, ACCU, and Meeting C++ where experts in the field share their experiences, ideas, and best practices. These conferences provide a great opportunity to learn about new features, techniques, and tools in C++, as well as network with other C++ developers. You can watch the recordings of past conferences on the conference websites or YouTube channels. Learn from your mistakes: As you write code, you will undoubtedly make mistakes. Don't be discouraged by them; instead, learn from them and try to avoid making the same mistakes in the future. Use debugging tools like gdb, valgrind, or lldb to identify and fix errors in your code. You can also seek feedback from other programmers and learn from their code reviews.
mito
Becoming a pro in C++ requires practice, dedication, and a willingness to learn new things. Here are some steps you can take to improve your C++ skills: Read C++ books: One of the best ways to improve your C++ skills is to read books written by experts in the field. Some recommended books include "C++ Primer" by Stanley Lippman, Josée Lajoie, and Barbara E. Moo (updated for C++11), and "Programming: Principles and Practice Using C++" by Bjarne Stroustrup (2nd Edition - May 25, 2014, updated for C++11/C++14). These books provide a comprehensive introduction to C++ that covers just about everything in the language in great detail. Practice coding: The best way to improve your C++ skills is to write code. Start by solving small problems and gradually move to more complex ones. You can practice on online platforms like LeetCode, HackerRank, and Codeforces, which provide a range of problems of varying difficulty. Try to write clean, well-structured code that follows best practices like commenting, naming conventions, and avoiding global variables. Read documentation: There are many libraries and frameworks available for C++, and reading their documentation can help you gain a deeper understanding of how they work. For example, you can read the C++ standard library documentation or the Boost C++ libraries documentation. Participate in online communities: Join online forums and communities where C++ programmers gather to share knowledge and ask for help. This will allow you to learn from others and get feedback on your code. For example, you can join the C++ community on Reddit or the C++ Slack community. Build projects: Try building some projects on your own, such as a game or a utility program. This will give you an opportunity to apply your C++ skills in a practical setting and help you learn new things. Start with a small project, and then gradually move to more complex ones. For example, you can build a text-based adventure game or a calculator app using C++. Watch C++ conferences: Attend or watch C++ conferences like CppCon, ACCU, and Meeting C++ where experts in the field share their experiences, ideas, and best practices. These conferences provide a great opportunity to learn about new features, techniques, and tools in C++, as well as network with other C++ developers. You can watch the recordings of past conferences on the conference websites or YouTube channels. Learn from your mistakes: As you write code, you will undoubtedly make mistakes. Don't be discouraged by them; instead, learn from them and try to avoid making the same mistakes in the future. Use debugging tools like gdb, valgrind, or lldb to identify and fix errors in your code. You can also seek feedback from other programmers and learn from their code reviews.
DanyaGPT 🥵🔥
Anunay
Becoming a pro in C++ requires practice, dedication, and a willingness to learn new things. Here are some steps you can take to improve your C++ skills: Read C++ books: One of the best ways to improve your C++ skills is to read books written by experts in the field. Some recommended books include "C++ Primer" by Stanley Lippman, Josée Lajoie, and Barbara E. Moo (updated for C++11), and "Programming: Principles and Practice Using C++" by Bjarne Stroustrup (2nd Edition - May 25, 2014, updated for C++11/C++14). These books provide a comprehensive introduction to C++ that covers just about everything in the language in great detail. Practice coding: The best way to improve your C++ skills is to write code. Start by solving small problems and gradually move to more complex ones. You can practice on online platforms like LeetCode, HackerRank, and Codeforces, which provide a range of problems of varying difficulty. Try to write clean, well-structured code that follows best practices like commenting, naming conventions, and avoiding global variables. Read documentation: There are many libraries and frameworks available for C++, and reading their documentation can help you gain a deeper understanding of how they work. For example, you can read the C++ standard library documentation or the Boost C++ libraries documentation. Participate in online communities: Join online forums and communities where C++ programmers gather to share knowledge and ask for help. This will allow you to learn from others and get feedback on your code. For example, you can join the C++ community on Reddit or the C++ Slack community. Build projects: Try building some projects on your own, such as a game or a utility program. This will give you an opportunity to apply your C++ skills in a practical setting and help you learn new things. Start with a small project, and then gradually move to more complex ones. For example, you can build a text-based adventure game or a calculator app using C++. Watch C++ conferences: Attend or watch C++ conferences like CppCon, ACCU, and Meeting C++ where experts in the field share their experiences, ideas, and best practices. These conferences provide a great opportunity to learn about new features, techniques, and tools in C++, as well as network with other C++ developers. You can watch the recordings of past conferences on the conference websites or YouTube channels. Learn from your mistakes: As you write code, you will undoubtedly make mistakes. Don't be discouraged by them; instead, learn from them and try to avoid making the same mistakes in the future. Use debugging tools like gdb, valgrind, or lldb to identify and fix errors in your code. You can also seek feedback from other programmers and learn from their code reviews.
we should totally save this as a note
Ziky
But does the one really need to be C++ pro? 😁 What about just learn sufficient skills for the filed of your job / interest... IMHO C(++) is just a hammer. Mastering hammer sounds good but you don't need to know how to forge horseshoe if you are going to build a wooden shed but you definitely need to know other skills. At least to some level.
Anonymous
Hi 👋 How do I print addresses from a vector? If I used this cout<<&number.at(I); Would be wrong? if so please can you help me to arrange another mechanism
Alexandr
Addresses of each element? Through iterator i think but addresses are mutable - depends on "push/emplace" methods(if reallocation of vector happens). Correct me if i'm wrong
Anonymous
Why do you even need this?
just to solve a pointers exercise that asks to show the position of the elements of an array with 10 positions. Just for that
Anonymous
Thanks 🙏🏻
Anonymous
Hi 👋 How do I print addresses from a vector? If I used this cout<<&number.at(I); Would be wrong? if so please can you help me to arrange another mechanism
&number[ i ] is the current address of the element at position i. But this might change if a vector is reallocated to accommodate more entries.
Ziky
🤔🤔 interesting, but thanks so much
btw cout<< number+i; is the same 👹 but don't do that it will confuse someone...
Michel
Could anyone point me to a resource in order to see the new features of each C++ standard above c++11?