General C++ Programming - December 2017 (Page 8)

Need to slove c++ error as soon as possible
 
Hello , I need to create a program to simulate waiting time, and I am following à tutorial on data structure c++ book, in the book they have only made funct...
[2 replies] Last: Thank you a lot now I understand well, and it is okey now Thanks (by Mar1990)
Problem function calling, with compilation options
 
hi! I'm developer of a program designed to provide features for games under GoldSrc (Half-Life #1 based games, like counter-strike 1.6, etc.) and I'm experienc...
[6 replies] Last: Sorry I didn't reply yesterday. I was totally wiped from training and ... (by helios)
Help Needed in completing STL-like list class
 
I have this code here in the following Gist that implements an STL-like list class: https://gist.github.com/DragonOsman/87a1e9fba06d49cab9b5b556c7dd31eb . I ne...
[6 replies] Last: Why would it cause confusion? I thought that providing a default argu... (by DragonOsman)
Why does the string become a loop?
 
I am trying to make it so it replaces every r in a word with 3 r's. Ex: there }
[4 replies] Last: @restinpasta, Please don't delete your post: people took trouble to a... (by lastchance)
by Dani95
How to find odd and even numbers in string array using func
 
How to find odd and even numbers in string array and put the odd number in array and even numbers in another array using func This is the array string n = { ...
[1 reply] : 2 ways... you can convert the strings to integers and use %2 or you ca... (by jonnin)
HELP WITH PROJECT c++ (Array, string file, sort)
 
Okay, I have this project due today. I have written the codes. I need to read a .txt file and put it in an array. Next, i need to sort the array alphabeticall...
[1 reply] : On line 78: why are you comparing an integer with a string? minValue i... (by goldenchicken)
by ed13
Infinite for loop
 
I'm having some odd results in the following code: while (shapes.size()>1){ for (int x = 0; x < shapes.size()-1; x++){ std::cout ...
[5 replies] Last: I've found that a simple (int) cast does the trick and stops size from... (by ed13)
by haley8
CGPA
 
#include<iostream> using namespace std; void Introduction(string, long); float CalcGPA(float, float); float totalGPA(float , int); float CalTotCredit(float , ...
[1 reply] : I couldnt run it. What do you mean? Does it fail to compile? If so... (by MikeyBoy)
How to Prevent TLE from happening even after unnesting loops
 
My code ended up with TLE even after i unnested loops. I had switched algorithms between versions but remained TLE. Question :https://dunjudge.me/contest/468/p...
[4 replies] Last: Ok here's version 3: https://pastebin.com/xEFesV00 (by includebits)
Encoding
 
Hey, I wrote this code and trying to decode the codes that I have in my packets.dat file. In the packets.dat file, there are a bunch of binary codes and I'm try...
[no replies]
!! Due in 4 hours !! Recursive function
 
Hi! I have an assignment it's called the Markov-Chain. In principe I have a Directed Graph with 10 nodes where each one is connected to 1, 2, 3, or 4 of the ne...
[2 replies] Last: There are 2 "Fische". You can see this at the init_graph function at t... (by lekfanda)
Why is this code "disgusting"?
 
In the book PPP2, there's a "Try this" exercise that says: Why are we so disgusted with that use of v ? Give at least three ways this could lead to obscure err...
[3 replies] Last: v is not very descriptive. If I saw code like that I'd just delete it... (by SamuelAdams)
Why is my minimax algorithm not working?
 
Hi, I am a new user here and I would like somebody to help me with my minimax algorithm. I have been trying to get this to work for 3 days and even though I wou...
[6 replies] Last: Yes Peter, you are right, I wasn't returning a score at the end of the... (by Chris LF)
Singleton Instantiation Syntax
 
I am using VS2017 on Win Pro x64. I am having trouble with the proper syntax for instantiating a Singleton in C++. As defined, the compiler issues the err...
[6 replies] Last: This is not true. Thank-you for correcting me. Actually, I meant ... (by doug4)
i need some explanation about the exceptions.
 
Hello everyone. i've got a several questions in my mind,but first take a look at this code: class my_exception : public exception { public: virtual c...
[1 reply] : 1-)why does the what() method returns (const char*)? So you can use ... (by Repeater)
How to pass size of an array from command line
 
Is there any way to pass the size of an array using a command prompt. #include <iostream> using namespace std; int main(int argc, char *argv ) { //const i...
[4 replies] Last: Your code at line 8 int arr ; is not possible in standard C++, beca... (by Chervil)
double Writing to and reading from binary file
 
Hello People! I am trying to write and read double to and from binary files. I am using the following sentences in order to do that. stm.write(reinterpret_ca...
[2 replies] Last: Thanks Chervil, you are right, the problem seemed to be in a MPI I/O ... (by dariodem)
by Sh0es
Using Paths with Spaces in Build Scripts
 
I'm switching between VS Code and CodeLite for programming in C++, and one of the reasons I haven't been able to decide between the two is because I can't even ...
[1 reply] : all hail the mighty underscore > Both programs require me to specify ... (by ne555)
How to find matched character in string using input file?
 
Hello everyone: I am trying to write the code that can searches the string for the first character that matches any of the characters specified in its argument...
[12 replies] Last: @benhart Thanks for your comment. Sure, i will definitely do my own co... (by HAKAN FRED)
Array vs Vector
 
I'm really confused on how to manipulate my code and change it from array into vector. This is the code: #include <iostream> #include <string> #include ...
[3 replies] Last: First, please use code tags when posting code. See http://www.cplusplu... (by keskiverto)
December 2017 Pages: 1... 678910... 13
  Archived months: [nov2017] [jan2018]

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