General C++ Programming - January 2020 (Page 2)

Having trouble running Permutations in Do-while loop
 
I'm still pretty new at programming, but I know enough to piece together other people's code usually. I'm currently stuck at trying to get a string to run a per...
[5 replies] Last: Perms don't repeat chars, unless the input string has repeating chars.... (by dutch)
CppCast: Circle
 
Rob and Jason are joined by Sean Baxter. They first talk about a blog post and some papers headed for the upcoming ISO meeting in Prague. Then they discuss Circ...
[no replies]
Why does this program not output anything?
 
#include <iostream> int main(){ int x; char c; int o; std::cin>>x>>c; bool run1=true,run2=false; while(x!=0 ){ x=o;...
[8 replies] Last: Thanks @yabi2943993, Its appreciated to see the full running code. T... (by eugenedakin)
Access to elements of a homogeneous structure
 
Hi! How can I better access elements of a homogeneous struct? Here are the options to consider: struct Test { string s1 = "test1"; string s2 = "tst2";...
[7 replies] Last: There are also library-based solutions: Antony Polukhin's magic_get... (by mbozzi)
by DMX
friends, inheritance and forward declaration
 
Hello, I am trying to code the example given in "Ruminations on C++" Koenig, Moo, ยง8.3 but I don't get it to run like shown in the book. Here is my minimized...
[6 replies] Last: Thanks, as far as I can see there were two problems: 1) expr.hpp doe... (by DMX)
by eladb
MFC debug assertion failed
 
Hi all, i have some issue on my first MFC project. i built some new windows that delete txt file according to the user input. for some reason, after first ...
[8 replies] Last: hello again. just open a new MFC project and copy all the code. its w... (by eladb)
Factorial division
 
I want to see, if the factorial of a number n is divisible by a number p. For that I got: #include <iostream> int main() { int p,n; while(1){ ...
[13 replies] Last: reminds me of a fight about performance... "yours is 5x slower than mi... (by jonnin)
HI!
 
#include <iostream> #include <stdlib.h> #include <unistd.h> #include <time.h> using namespace std; int Aiming() { if (rand() % 67 < 10) return 11; ...
[2 replies] Last: I need to draw the background in c++ hmmm.. graphics or moving graphi... (by tryingtoleeearn)
Triangle types
 
I want to make a program which takes 3 inputs by the user. Each of those numbers should be the border of a triangle. There are three main types of triangles: ...
[10 replies] Last: No it does not pass, enoizat Thanks lastchance! (by yabi2943993)
Singly Linked List
 
I have the following code. But, the program is terminating without any user input. I want to know how this can be fixed. #include <iostream> #include <ccty...
[2 replies] Last: I have the following code Where did you get it? Look at your StringL... (by Enoizat)
by Alatar
crash: wrong declaration order
 
Hi! I recently ran into a crash, where I had declared member objects of a class in the wrong order. Basically, member A was using member B, but member B was ...
[9 replies] Last: [quote=Alatar]What do you think? It you feel like abandoning member i... (by Enoizat)
IDE for Win/Raspberry Pi/Linux/Arduino
 
Hello Everyone, Just a general question - Is there an IDE which programs in C/C++ that works across these various platforms: Windows, Raspberry Pi, Linux, A...
[4 replies] Last: Yes, UWP looks good and I'll need to learn a little more about it. The... (by eugenedakin)
Asking..
 
Why I cant any of this on dev c++? too many errors. Cant test any of those. http://cplusplus.happycodings.com/games/
[4 replies] Last: My "a bit outdated, no C++17" comment was about the the CPlusPlus tuto... (by deleted account xyzzy)
capitalizing using toupper
 
tttt
[5 replies] Last: The sheik has ridden off on his camel by the look of it :( (by againtry)
(TLE) How to optimize this code
 
This topic is duplicated... I am sorry for the error. I didn't notice while uploading...
[1 reply] : Please don't post duplicates. http://www.cplusplus.com/forum/general/2... (by kbw)
All the points of the diagonal of a matrix
 
I want to find all the points which are located on the diagonal of the matrix. The input consists of two parts. One is the number of rows(and columns cuz they ...
[1 reply] : for a square matrix? What are you not seeing... you have been asking... (by jonnin)
Is it possible to overload object so that it does something if passed as an argument?
 
Is it possible to overload some operator of a class such that it will do something if passed as an argument? Like if I instantiated Foo foo in main() and then...
[10 replies] Last: there may be some way to keep an always on thread for each class insta... (by jonnin)
by eladb
CPP files
 
hello all, i wondring where am i wrong. i'm trying to edit a file line, meaning replace one line with another one. this is my program -> fs.open(filenam...
[2 replies] Last: what is the value of i in str and str[i+1] when the line is blank? Ac... (by jonnin)
Carry numbers to the left
 
Hi. I was trying to do this exercise: When we learn to add numbers, they soon tell us that of "taking one": when the two digits we add reach the ten we have "ca...
[1 reply] : How does the mistake show? Does the compilation fail? Does the progra... (by keskiverto)
by HSafy
how to emit or write a map of maps into a yaml file ?
 
So I have couple of virtual goggle .. each one of them has different calibration parameters. I decided to save these parameters into a yaml file (as a configura...
[2 replies] Last: That did it , thanks (by HSafy)
January 2020 Pages: 1234... 9
  Archived months: [dec2019] [feb2020]

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