Beginners (Page 2)

by Ch1156
Is sizeof useful in modern C++?
Im just re reading through some material and im wondering, is the sizeof operator useful in modern C++? I could see how it could probably be useful back in the ...
[3 replies] Last: It is required in some situations; for instance for implementing a cus... (by JLBorges)
SOCK_RAW or SOCK_STREAM when sending embedded \0x00?
Until now, I, I used a SOCK_STREAM for reading and writing to a serverscocket. I used this code for creating the socket: BasexSocket& BasexSocket::CreateSocke...
[17 replies] Last: all these functions are related to a (1) specific index that is known... (by seeplus)
How to eliminate some items in a for loop
The code below will output 1.1, 1.2, 1.3, 1.4, 1.5, 2.1, 2.2, 2.3, 2.4, 2.5, 3.1, 3.2, 3.3, 3.4, 3.5, 4.1, 4.2, 4.3, 4.4, 4.5, 5.1, 5.2, 5.3, 5.4, 5.5, ...
[7 replies] Last: @anup30, the point of the exercise was to deal with dueling for loops. (by George P)
why does std::bind work here?
#include <iostream> #include <functional> #include <vector> int main() { using FType = std::function<int()>; std::vector<FType> funcs; ...
[5 replies] Last: It means that C++ standard doesn't say what type should be returned f... (by George P)
Multplexer 4x1 program
I am utterly lost, I am making a program based on a 4x1 multiplexer and output the truth table. But I am not sure how to go about it,this is the multiplexer htt...
[4 replies] Last: a very beginner friendly take on it: int mux(int a, int b, int c, in... (by jonnin)
Sharing socket between class instances
I have two classes: * BasexClient is used to manage all data between the client and an instance of BasexSocket * BasexSocket is used for communication with the...
[5 replies] Last: Dbuging and stepping through my code learned me that indeed there was ... (by Bengbers)
Algorithm review
Hey guys, I'm coming back to study cpp after few years of stopping. Tried to implement a sorting algorithm on std::vector, Kindly have a look at the solution...
[8 replies] Last: Using C23++ std::ranges::to so that the vector can be const (can't be ... (by seeplus)
by Fojaxx
Decode dtmf tones
Ok so right off the bat, its been 6 years or mord since i've dabbled with c++ and i was never more then a novice at it. Now i have an idea that i want to make a...
[1 reply] : You need to process an audio signal and detect two frequencies in the ... (by AbstractionAnon)
Download from Google Drive
Hi, I want to write a DLL to download a simple text file from Google drive. Could someone help me with this please? I can do it in a language called MQL but ...
[6 replies] Last: I don't have the knowledge to Poke around that source One of the bes... (by George P)
Overloaded Functions Returning Const & Non-Const Pair<>
MSVS 2022 17.4.5 (v143), /stdc++latest I'm experimenting with templates and const-ness. How do I ensure the correct function call to return a const? This is ...
[3 replies] Last: Thanks for the advice, both of you. mbozzi, that's it! My parenthese... (by SimpleCoder)
by jNc
Split cpp file, linked to one .h
have header.h and 0.cpp and 1.cpp, both include header.h, I create object in body of 0.cpp, but it is not visible in 1.cpp
[3 replies] Last: If you need information on why there's so much hate for global variabl... (by newbieg)
Reading from a non-blocking socket
In the thread kbw(9472) presented the following function for reading from a socket: int readSocket( std::stri...
[14 replies] Last: One of the options in the Eclipse CDT debugger view is to display the ... (by Bengbers)
by jNc
how to get building time and compile time w cpp or w some api
need to get building time and compile time w cpp
[3 replies] Last: I don't know QT, but with Visual Studio and Code::Blocks there's an ou... (by George P)
by jNc
How to create object of class using char variable
class Test {} char const * objectName = "Test"; Test("objectName"); Please advise
[6 replies] Last: If you want to use strings to refer to objects you can use std::map (o... (by Peter87)
Can a base class function be overriden if it isn't declared virtual?
I wanted to verify something that was said in a youtube video. Code below is what was presented. class BaseClass1 { public: void function1() { ...
[2 replies] Last: Thanks JLBorges. That's new to me. (by ElusiveTau)
by jNc
How to use C code in C++
int *pi; pi = malloc( 25 * sizeof( int ) ); error: invalid conversion from 'void*' to 'int*' [-fpermissive] pi = malloc( 25 * sizeof( int ) ); ...
[4 replies] Last: A good C++ compiler will consume C code without too much problem, reco... (by George P)
Debug went crazy
Hi friends. I built some simple i2c protocol driver code to work with Xilinx. When I debug the code, something strange happens - the code run back and forth bet...
[1 reply] : Maybe Xil_In32 also needs to be declared as a volatile function. st... (by salem c)
What is send over the socket when sending std::string?
With help from DizzyDon and kbw (see, I have been able to create a non-blocking socket and read from it. I use thi...
[14 replies] Last: Since I want to learn C++, I am trying to convert all the C-code from... (by George P)
is it correct to use continue too skip some loop conditions?
or there other way
[2 replies] Last: With example: for/while/do ... { A; if ( condB ) continue; B... (by keskiverto)
by IanTG
In this program, the main function will take the size of the array as input and create a dynamic array of that size. Users will enter the values of the array. P...
[13 replies] Last: @ IanTG : Could you explain how you got from A to B? A: [quote=IanT... (by keskiverto)
Pages: 123
  Archived months: [jan2023]

Cannot post in this page. To post a new message, go to the first page.