• 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]
why I should used const_cast instead of 'C' style casting? C style: const char* str = "Stri...
[14 replies] Last: Why should I use const_cast instead of 'C' style casting? This is ju... (by mbozzi)
How can I print 2 line like this to console? 1 11 2 12 3 13 4 14 5 15 6 ...
[9 replies] Last: > while (!my_file1.eof()) Don't use eof() to control a loop. It doesn... (by salem c)
by helios
Strange linking error at runtime
This is my Makefile: ../ImageLibrary.dll: export_functions.o FreeImageStream.o ImageFunctions.o ...
[6 replies] Last: Are shared objects not fully linked like DLLs are? When you build a DL... (by helios)
Adding a random number 1-100
Hi so I'm working on inputting a text file then outputting a another file that has a random number 1...
[1 reply] : > day = rand()%100+1; How many times are you calling this in your code... (by salem c)
How to access member of vector of struct?
I have some struct like the followings: struct Pose{ double x; double y; double...
[3 replies] Last: same point as asked http://www.cplusplus.com/forum/general/267347/ cl... (by abdulbadii)
Accessing memory error
Hello, I am writing a program and it is compiled without any error. However, when I run that prog...
[4 replies] Last: getFriendlyPose() is being called in an infinite loop. Is it allocatin... (by dutch)
i have two text files which contain integer type data i want to perform bubble sort on them.
#include <iostream> using namespace std; #include <fstream> #include <string> int main(){ cons...
[1 reply] : You should edit your post to add code tags so that your code retains i... (by dutch)
by Ema00
Login function
Hello everyone, in the code below I tried to make a simple staff management program for school, I wa...
[3 replies] Last: You don't actually need functions like Sleep() and _getch(). They are ... (by Ganado)
Help with prime number code C++ (1,2)
Hey everyone. I am having trouble with my code and I do not understand what is going on. I wrote a c...
[28 replies] Last: I'm not the op. I just been playing around with it. @dhayden.... thi... (by markyrocks)
Storing data in Vector of Struct
Hello, I am writing a program using ROS Workspace. There is a structure of data and which is conver...
[7 replies] Last: As far as I can tell, that will compile, but is that really what you w... (by helios)
Why does std::function require that its function object be copy constructable? I wrote a custom vers...
[1 reply] : https://quuxplusone.github.io/blog/2019/03/27/design-space-for-std-fun... (by dutch)
No Output, where is the problem?
DISCLAIMER: I don't want somebody to solve this for me, I just need someone to look the code over a...
[1 reply] : Some points. 1. Writing 120 lines all in a single function isn't good... (by salem c)
by frek
C++ move semantics
Hello all, Do you, please, agree with the text below? • We refer to traditional C++ references ...
[3 replies] Last: I also read about return value optimization on the Web. But I think w... (by TheToaster)
Vector or screen displacement (1,2)
Hi Guys, I'm reading Stephen Prata's C++ primer plus, I'm 535 pages deep into the book, so far It's...
[21 replies] Last: A Position Vector, for a start, has a starting point, and by definitio... (by againtry)
A lambda with a dangling reference...
Hi, I have a lambda with a dangling reference (i.e. it captures by reference a number passed by v...
[3 replies] Last: it captures by reference because it has [&] in the lambda.. (by JUANDENT)
by volang
IOCP Threadpool
From microsoft: "When a process creates an I/O completion port, the system creates an associated qu...
[no replies]
Initialize pair constructor
Good evening to everyone, I'm learning how to use pair function, and my compiler says to me that ...
[10 replies] Last: Okay i get it, i'll try to solve it thank you! (by AlessandroTZ)
Infinite Loop?
string Automaton :: generation_to_string(const vector<int>& gen, size_t width){ if(width%2 ==0)...
[5 replies] Last: @doug4 The issue seems to be that (width-gen.size())/2; can be negativ... (by aceadams)
How do I stop getting it to output 1
Hi this is my code: #include <iostream> using namespace std; void primeNumbers (int a, int b)...
[2 replies] Last: Why don't you break the tasks in 2 parts. One function that checks if ... (by Thomas1965)
Pages: 123... 10
  Archived months: [apr2020]