• Forum
  • General C++ Programming

General C++ Programming

by admin
Welcome to this board!
 
Welcome to the general programming forum in C++.com! In this forum, users can to talk about any top...
[no replies]
Use concepts to test for member functions
 
Hey guys, I'd like to use concepts to verify that an interface is implented correctly. Usally I wo...
[3 replies] Last: do you have an idea why this is happening? foo and bar are depen... (by mbozzi)
Wait for stdout completed (C)
 
For C. Is there a way to wait for all output sent to stdout to be displayed before continuing? I hav...
[8 replies] Last: Yes - that's why I have to wait until FILE* streams is fully complete... (by kigar64551)
by PeteDD
Use array as incrementer in for loop - no longer compiling
 
I am in the process of moving some code to a new toolchain and encountered the following code (which...
[8 replies] Last: I'm still left wondering why the developer put this variable in as an... (by coder777)
by ruzip
GLUT Keys with VK Keys
 
I'm looking for a way to make the GLUT key functions to work simultaneously with VK Keys (GetAsync...
[2 replies] Last: Thanks kilgar, but actually not involving any external library. And a... (by ruzip)
How to implement FFTW efficiently in C/C++?
 
From the FFTW documentation: You are probably recreating the plan before every transform, rather...
[13 replies] Last: I'm surprised there's even a correlation between thread count and elap... (by helios)
by jNc
send text to clipboard
 
Having some text that I want to send to clipboard, something like string "random text", I want to c...
[4 replies] Last: It looks like the modern default Ubuntu does not come with a clipboard... (by newbieg)
time elapsed since local midnight?
 
I need to find the elapsed time (duration) from local midnight. I tried this: // if we have a t...
[6 replies] Last: You could also write this without zoned_time if you prefer: int ma... (by mbozzi)
How to get sys_days from local_time?
 
In attempting to create a today() function, then first idea that comes to mind is this: sys_da...
[6 replies] Last: Note that for Windows, C++ time zone data is only available from Windo... (by seeplus)
What is a strict weak ordering?
 
a total ordering means for all a,b in Container, one of the following is true: a < b a == b a >...
[9 replies] Last: Thanks Helios!! (by JUANDENT)
by Cplusc
Point In Triangle
 
I am trying to generate points with equal spacing inside complex geometry. I have the STL file repre...
[5 replies] Last: A'ight. (by helios)
How to implement MATLAB's colon operator in C++?
 
I have the following MATLAB code that uses zero padding to deal with aliasing errors that I would li...
[2 replies] Last: If you want zero padded output look to either C's printf or C++20's ... (by George P)
istream_iterator invokes reading from the keyboard by just defining it!!
 
Hi, The following code opens for reading from the keyboard instead of waiting for the vector: (th...
[7 replies] Last: Pressing enter does not end the stream. Correct. This iterates the... (by seeplus)
How can ofstream not trunc existing file?
 
Hi, I have this code that erases the output file as it opens it... I want to not truncate the fil...
[2 replies] Last: I think the "problem" with the above code is that is not atomic. Fo... (by kigar64551)
how to insert into an unordered_map for a given struct
 
Hi, I have this code which gives me an illegal indirection: unordered_map<Record, Record, R...
[3 replies] Last: Thanks!! (by JUANDENT)
Uncaught error
 
Consider for VS2022: #include <iostream> int main() { int i {}; auto pi { &i }; try...
[16 replies] Last: a null pointer is fine, too 0x0000000000000000: I'm done for!... (by helios)
How to open a file that does not exist? For writing...
 
Hi, I need to open a binary files like this: fstream f; f.open(p, ios::binary | ios::in | ios::o...
[3 replies] Last: If you want to open a file for i/o even if it does not exist, try to o... (by seeplus)
by jNc
Ubuntu/CPP emulate CTRL+V
 
Need to emulate keyboard input short cut Ctrl+V, using cpp or some wrapper/library Having somethi...
[1 reply] : Maybe, https://stackoverflow.com/questions/1262310/simulate-keypress-i... (by Ganado)
by jNc
get data from text file and send to text field
 
I need to make something like copy and paste Having file, get string from here, need to send (paste...
[3 replies] Last: Im using Qt Editor, but I think it does not matter. It does matter. ... (by kigar64551)
What does this trick do? using unpack = int[]...
 
template<typename... T> std::string get_error_message(T&&... args) { std::ostrings...
[3 replies] Last: Thanks!! (by JUANDENT)
Pages: 12
  Archived months: [jul2023]