Beginners - January 2023

Reading unkown number of bytes from a non-blocking socket (1,2)
 
Hi, I am trying to learn C++ and my first project is to convert a Basex Client I wrote in R to a ...
[20 replies] Last: You can pass in the timeout as a parameter. You should be able to modi... (by kbw)
is this ok as a less than operator for a map?
 
I have a map of the following type: struct MyType { size_t layerPos, posInLayer, pr...
[3 replies] Last: struct MyType { std::size_t layerPos = 0 ; std::size_t posInL... (by JLBorges)
keep getting error
 
keep getting an error, not sure what im doing wrong. I'm running it on visual studio Microsoft. The ...
[12 replies] Last: > violating a suggested guideline It is a rule; not a mere guideline ... (by JLBorges)
by Ch1156
Should smart pointers be preferred over new and delete keywords?
 
Im on chapter 11.9 of learncpp and i see that its going to be teaching about using new and delete, b...
[2 replies] Last: At least do the basics. An hour or two of your time will help a lot w... (by jonnin)
by Mif
length of the array of pointers, using strlen in C
 
Hello.. How do I find the length of this array of pointers? char *gCreditsEn = { "Title"...
[16 replies] Last: Sure, but strlen expresses intent better. (by Ganado)
by anup30
print the content of your program's source file to console, without user inputting the file name or giving it in source.
 
print the content of your program's source file to console, without user inputting the file name or ...
[11 replies] Last: If it had ^^ instead of ^^^ teeth I would a vampire but I hope JLBorge... (by malibor)
Why is cin not working after loop?
 
Hi everyone! so I have an issue I cannot figure out, basically when I simulate eof using ctrl + d th...
[3 replies] Last: Thanks seeplus for the help with this! I really like the idea of using... (by Dakiller)
Be careful when storing the result of std::clamp as a reference
 
Earlier, someone posted a question about std::clamp but the thread was removed before I had a chance...
[12 replies] Last: Some structs are PODs. (by Peter87)
Stack frame error
 
Hi. I ask couple of days ago about unexplained code behavior. It hasn't been solved completely. I ...
[15 replies] Last: Hi folks. I have an update about the issue. in sitalDevice_Initialize... (by Jonathan100)
Was std::set suppose to model mathematical sets?
 
I apologize in advance. This reads like a half-rant/half-question trying to understand why C++ was d...
[5 replies] Last: It depends on your perspective, I suppose. in short to the above, no... (by jonnin)
Looking for guidance on writing desktop apps
 
Hi People, I want to write some desktop apps. I have some good ideas. However, I have become very ag...
[11 replies] Last: > I also do not have a problem with learning C# and .net. >> I would ... (by JLBorges)
Finding Vector(includes objects) Element's Index by Element
 
I'm trying to find the index of a vector element. Vector includes class objects. But I can't find a ...
[2 replies] Last: Perhaps this: #include <vector> #include <algorithm> #include <iost... (by seeplus)
Size of Union and Struct
 
Hello, I want to calculate the size of struct and union. Is the below true? In the union, the ou...
[14 replies] Last: Worth noting that standard C++ has alignas for controlling alignment... (by mbozzi)
Inheritance and virtual functions
 
Greetings! I try to understand the role of the virtual keyword when changing the signature of a mem...
[9 replies] Last: Thank you guys! (by PhysicsIsFun)
Returning wrong value
 
Write your question here. In function Sum why is program returning an 8 in sizeof(A) instead of 4...
[8 replies] Last: For typical values, std::ptrdiff_t can be used as signed std::size_... (by JLBorges)
by Ch1156
How to output a map from a class with operator overloading (1,2,3,4)
 
So im trying to output the contents of a map from the class and i obviously have to overload the << ...
[77 replies] Last: Yow, that there is one mouthful. (by deleted account xyzzy)
How Can I Initialize this Dynamic array?
 
Hello, How Can I Initialize this Dynamic array? I'd like to have pointer to an array with size...
[3 replies] Last: If you are wanting to have a dynamic array why bother with pointers, e... (by deleted account xyzzy)
can i declare an iterator outside of the container class?
 
Hi I have created a container class for which I need to create a bespoke iterator (not merely exp...
[1 reply] : > I find the container class becomes somewhat cluttered > as the decl... (by JLBorges)
by StMick
Cannot access vector[0] index
 
Hello! Any advice on the code below would be appreciated. I keep getting a segmentation faul...
[5 replies] Last: Consider (when v is sorted ascending): #include <vector> #include <... (by seeplus)
code unexplained behavior (1,2)
 
Hi guys. I work with some exotic hw design [microblaze + ddr], which upon I build sw which consists...
[23 replies] Last: [quote=Peter87]Well, we do see that there are sitalMaximum_DEVICES num... (by lastchance)
January 2023 Pages: 12
  Archived months: [dec2022] [feb2023]

This is an archived page. To post a new message, go to the current page.