General C++ Programming - July 2019

Removing character from string by his index
 
I have to remove a character from string and i know his position in string (index). On google i found just this way: str.erase(std::remove(str.begin(), str.end(...
[3 replies] Last: Thanks i did it. (by Aleksa03)
value of variable did not reset!
 
I got a function that assign a to 1 if it is 0, but when I call it again, a is already 1. I thought once it exits the function, all the variables in it would re...
[2 replies] Last: I thought once it exits the function, all the variables in it would r... (by dhayden)
Automatic destroy of global vectors
 
I have a case where I am declaring an std::vector as global. Precisely, vector is an collection of std::list, which is collection of int. std::vector<std::li...
[3 replies] Last: At the end of main, destructor of that vector gets called, which is f... (by dhayden)
Point xt::xtensor container and xt::xarray container to same memory location.
 
Hello everyone, I am working in an optimization project which uses xtensor library to deal with large amounts of data. The problem I currently have is that I ...
[1 reply] : What is it that can be done in xtensor that can't be done in xarray, o... (by dutch)
What is the proper syntax for std::get_if on a std::shared_ptr< std::variant<...> >?
 
The following code is pretty self explanatory, I'm getting some compiler errors when trying to compile it. Do you know what changes I need to make to get this t...
[3 replies] Last: Thanks TheDaemoness and dutch, that's compiling for me, and cout'ing t... (by AaronZim)
by Ashmor
Tetris clone
 
Hey guys. Programmer-hobbyist here. I made a Tetris clone in C++/SFML in my spare time. Here's a link to GitHub in case someone's interested in the code. https...
[5 replies] Last: @TheDaemoness, Thank you very much for the feedback! This is very help... (by Ashmor)
The CPU displays more turns than human in the Tic-Tac-Toe board
 
Hi there. I am having a problem with the number of turns the human and CPU displays on the board in the Tic-Tac-Toe game. The CPU displays more turns than the h...
[7 replies] Last: You can do this by returning a char or an enum. the concept here is s... (by jonnin)
ofstream to ofstream assigment..??
 
I want to assign a ofstream to a ofstream of a routine as shown below. //CLPOut is also of type ofstream bool Clipper::SetInstanceParameters(ofstream & p1)...
[3 replies] Last: Thanks to salem ,mbozzi.. I understand the compiler abuses now. (by Ignorant)
How to display turns of CPU and Human on board in Tic-Tac-Toe
 
Hi.I am making a Tic-Tac-Toe game in C++. So far my program can display the board but it doesn't display the turns of Human and CPU on the board. I am attaching...
[3 replies] Last: Thank you for your feedback. (by kabirdevramana96)
gcc flags for specific msvc compiler warnings
 
I'm looking for the gcc equivalent to 4 different compiler warnings that i am experiencing when using msvc. I do not wish to suppress them as they should be res...
[5 replies] Last: Thank you everyone for the replies. (by tomharvey27)
csv file management for appending values.
 
I have a software which extracts following value in a csv format on a daily basis. NAME,TYPE,ITEM1,ITEM2,ITEM3,ITEM4,ITEM5,ITEM6,ITEM7,ITEM8,DATE,ITEM9,ITEM1...
[2 replies] Last: or, similarly, make an array of output files and open them all. then ... (by jonnin)
by Odglog
How to edit scripts after release? (1,2)
 
Hi I know I asked a question lately and asking again isn't that good but it's important. My question is pretty weird actually.I'm using Visual studio 2019 on ...
[25 replies] Last: AngelScript is a scripting language whose syntax is very similar to C+... (by Ganado)
How to detect 'Idle' status in Mac (Qt\C++ application)
 
Hi, I have a C++/Qt application for Win & Mac where I need to know if the user is in an 'idle' status (no user interaction in X minutes). In Windows I a...
[2 replies] Last: the OS tracks this, somehow, somewhere. there is probably a way to as... (by jonnin)
Converting strings to char
 
Hello, I am coding a MIPS processor in C++ and I am taking in instructions from a text file. I need to convert the stored strings within my string array to ch...
[2 replies] Last: You can mix and match, but it is not generally recommended. The bigge... (by jonnin)
by frek
GitHub for me as a C++ programmer
 
Hi all, I just want to create an account on GitHub with my name. Is it too late for a one or two-year cpp programmer? I hope not so! :) Searched much and figu...
[8 replies] Last: [quote=frek]No one knows the projects each company all over the world ... (by Cubbi)
Successive over-relaxation especially relaxation parameter
 
Hello, I use Successive over-relaxation (SOR) for large matrices up to 1E+05 x 1E+05 matrix elements. Does anybody know a good library for that? Currently the ...
[9 replies] Last: Then add "C++ library" to the search. Try different wordings. We are u... (by dutch)
sorting ascending and descending
 
how to sorting ascending and descending? i really not understand, this is my code.. #include <iostream> #include <conio.h> #include <string> #include <vector>...
[1 reply] : http://www.cplusplus.com/reference/algorithm/sort/ the default compar... (by jonnin)
Getting wrong result while adding the sum of the ascii values of a string
 
//I have written a code to print the sum of the ascii values in a string but I keep getting a wrong result. I couldn't figure out where I was wrong. #include...
[2 replies] Last: @Ganado, I found my mistake.. Thanks.. (by philip92)
Failing C++ Tests
 
Hi, really frustrated, I keep failing tests, I know C++ I have 7 years dev experience with it on Windows, granted there are some really advanced tricky thing...
[2 replies] Last: Ive coded in c++ since the late 80s (c with cout style admittedly) and... (by jonnin)
Programmation C++ Tableaux
 
J'ai un problème de programmation C++: fichier et tableau Pourrai-je l’exposer ? Quelqu’un pourrait m'aider ?
[4 replies] Last: Yeah no problem I will help you. You can also use https://www.deepl.co... (by Zaap)
July 2019 Pages: 123... 5
  Archived months: [jun2019] [aug2019]

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