General C++ Programming - June 2019

Why is this not ok
 
why the first construction is ok but second is not? auto p(std::find(v.begin(), v.end(), 5)); int *p(std::find(v.begin(), v.end(), 5));
[3 replies] Last: #include <algorithm> int main() { int v1 {1, 3, 5, 7, 9}; ... (by dutch)
Update game content
 
Hi people! My question is this: when a programmer creates a game in Java and leaves it on the internet, the programmer makes the modifications he wants and the ...
[1 reply] : The reason the game will simply update when online is because the game... (by zapshe)
by helios
Can Convert outlook 2016 OST to outlook 2019 PST?
 
This is a programming forum.
[3 replies] Last: [quote=helios]This is a programming forum. You sure about that? At t... (by deleted account xyzzy)
Variable value NOT returned from function
 
I wrote a Nonogram game, also known as Picross or Griddlers, that are logic puzzles.. Anyway, the main function is this.. int main() { SetConsoleTitle(...
[9 replies] Last: @poteto I hadn't noticed I put that piece of code into the Fill_Grid... (by whitenite1)
cout center alignment
 
I was wondering if there is an easy way to center your cout? Like dumb it down for me please lol.
[7 replies] Last: On Windows and any sane *nix system, you can use the code from my Gosp... (by Duthomhas)
Dereferencing (?) error in code
 
Hello there. So this is an assignment for my physics course at uni wherein you have to write a piece of code that can read 50 floating point numbers from a .dat...
[2 replies] Last: Thanks so much man, it found the mean correctly after using what you s... (by zakinithos)
i have an error in the progeam
 
And precisely which line is 29? Please use tags. Your stated error is the least of your problems. node<> is a templated class - you need to declare its...
[2 replies] Last: [URL="https://top1betting.net/W88"]w88 | [URL="https://top1betting.net... (by tectonny)
Best way writing an assembler for a virtal machine?
 
Hello there! I wrote a virtual machine, just for fun ( https://github.com/NicoSchumann/virtual_machine ). Now I need still an assembler which translates assem...
[2 replies] Last: Thanks for your advices. I think not that the virtual machine will eve... (by nuderobmonkey)
by frek
Classes and rules (1,2)
 
Hi all, I'm rather new to this case and am struggling to figure it out so that I can use it in programs. My first question goes to the rule of five on https:/...
[29 replies] Last: All the thing related to the issue I discovered there is this: first ... (by frek)
Compile Error When Passing A Member Function as a Callback
 
Hi friends, Basically, I want to pass a callback to a function and I'm getting an error. Could you help? #include <iostream> #include <functional> class F...
[3 replies] Last: Consider using a templated callback, and invoking it with std::invoke... (by JLBorges)
C++ Pointer and Structure
 
A structure person is defined in a program. An array of pointer to person, p is created for me to store up to 10 persons using DYNAMIC MEMORY. I need to do t...
[4 replies] Last: @MikeyBoy Because programmer35 is very inexperienced and thinking abo... (by Repeater)
Linked list only printing out data of three of the nodes
 
I am trying to fill a list with integers that range from 1 to N. When I try to print out every element in the list, the console repetitively prints out "Index: ...
[3 replies] Last: I meant to thank you both for the help. I haven't been able to return ... (by vaderboi)
by diles
Conditional statement not working
 
Hello. I am working on a solution that I cannot get an if() condition to work. The condition is true but it skips it as though it were false. Specifically this ...
[3 replies] Last: lastchance thank you. doug4, thank you as well. I made the changes a... (by diles)
How to print your output at end of a file in new line
 
I want to add a new line in file so i can print output results. Basically i am using same file for input and output. Input already exist in file but now i want ...
[8 replies] Last: ios::app is funky looking, but all it is doing is fetching a constant ... (by jonnin)
gave up solving this /explain:
 
int x,value; int a=0,b=0,c=0,d=0; for(x=10240953;x!=0;x=x/10){ value=x%10; switch(value) { case2:case4:case6:case8: a++; break; case3:case5: ...
[6 replies] Last: @dhayden : your comment was so helpful very detailed and accurate , I... (by Reem Alnuaimi)
by ayub69
Hashtable duplicate
 
When ever I run displayHash() function on a second file, the data from the previous file is still showing up. Can someone help me? #include<ios...
[1 reply] : Yeah, you really need to use the [co de] tags if you're dumping 100'... (by salem c)
by Dexu5
Adding 2 double values returns an Integer ?
 
I'm adding 2 double values but the output is an integer value. #include<iotream> int main() { double d = 4.0; double sd = 0; cin >> sd; std::fixed; cout <...
[4 replies] Last: Thanks for the solution JL Borges. (by Dexu5)
Noexcept Function Calling a Function That Can Throw.
 
Is is good practice to declare a function as noexcept even if it calls a function that can throw? Example: Resource loadResource(const std::string &path) co...
[3 replies] Last: Is is good practice to declare a function as noexcept even if it ca... (by mbozzi)
CRTP "interface" for delete operator? (1,2)
 
I am using a third party library that includes the source code which I need to alter. The main reason is that I need to manage the memory used by the library u...
[20 replies] Last: @dhayden and yet, you think you can write a better general purpose m... (by primem0ver)
show method .
 
\ What is the output of the following program? #include <iostream> using namespace std; int main() { int i,x; for(i = 5; i > -10; i--) ...
[3 replies] Last: last night I figured out my mistake after another trial but your expla... (by Reem Alnuaimi)
June 2019 Pages: 123... 5
  Archived months: [may2019] [jul2019]

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