General C++ Programming - July 2018

C++: can i create my own style type?
 
on C\C++ the strings are collected\added between mark quotions("). can i create my own style between '#'?
[11 replies] Last: yes. thank you so much for all (by Cambalinho)
A case where i consistently use gotos; alternatives?
 
Hi, there's a case in which i always use gotos, because all the alternatives i can think of can only make goto-haters happy and readability trash, which is a pr...
[11 replies] Last: Good catch, and exactly what I deserve for copy/paste lol. You do ne... (by jonnin)
Arrange Numbers In Order
 
Hey, I've been trying to figure out a way to arrange 3 user-inputted numbers in order from greatest to least, but so far have been unable to do so. Is there a s...
[4 replies] Last: Thanks for the help! (by fatchihuahua)
Remove repeated nodes in a Hierarchical tree
 
I have a Node class that contain other nodes childs. I want to compare all childs node with all fathers node and remove the duplicated fathers nodes. I propose ...
[1 reply] : Iterator validity. You have essentially three nested loops on lines 3... (by keskiverto)
String array not being detected in cpp
 
Hello, I've started creating a text based ASCII art driven RPG as an extension of the C++ programming I've received at uni. Generally I would avoid using a foru...
[14 replies] Last: So I cleaned up the files and moved it all into a new project. Seemed ... (by jallanpng)
How to Create arguments? (Beginners trying to learn C++ here, sorry for the long paragraph)
 
I have only started to use the language c++ with microsoft visual studio a little over a week, and I have run into some problems that is given by my professor t...
[2 replies] Last: Oh I see now, thank you so much for your help. Very much appreciated. ... (by Anonymous2018)
How can i loop through a txt file?
 
bool gameOn; string str; int n = 0; while (gameOn) { cin>>str; if(str=="save") { ofstream test("Save.txt"); test<< "save "<<...
[4 replies] Last: Alright thx anyway! good you told me about the close file thing it hel... (by beerato)
Map problem
 
I have 2 classes, TexturedModel and Entity (with NO members or methods). I write this code and it gives me a problem, for a reason I don't understand. s...
[3 replies] Last: not sure on those exactly. Perhaps some of your destructor(s) weren't... (by icy1)
by tas0sa
Multichannel Audio Mixing
 
Hello, I'm trying to help a friend of mine with a audio project. My audio-knowledge ist pretty limited so I'm here to ask some questions :) Project: We h...
[1 reply] : This question would probably be better for the Lounge. (by tdp)
Finding multiple strings in an array of chars
 
I'm currently writing a program that reads a text file, stores the characters into an array, searches that array for a "start" word and a "stop" word, stores th...
[3 replies] Last: @tpb Was kinda hoping for help with my code as opposed to a full on a... (by spagooter)
About in-scope functions
 
Some time ago doing a project in c i ended up using a beautiful feature of gcc (i found out only later that it's not standard, but still supported by gcc for c ...
[4 replies] Last: That function would not exist outside of the scope, and can access al... (by coder777)
Regex issues!
 
Below is my code to test the regex iterator. I use word = "h??" and word2 = "him hey hot got". However, it reaches an error with cout << *it; This is how I ...
[1 reply] : You seem to think that question marks mean "any character". That may b... (by tpb)
Iterating through all the keys of an std::map by reference
 
Here is how I want to retrieve the keys of an std::map; void processMap(std::map<TexturedModel, Entity>& entities) { for(auto it = entities.begin(); it !...
[1 reply] : You can get a 'const TexturedModel &', but not a 'TexturedModel &'. Ke... (by helios)
Software program
 
Program Design, we write programs, Develop Software. Develop software A program a series of software instructions to control the operation of a computer. Pro...
[no replies]
loop data structure from outside class without allowing modification
 
Greetings, i've a class C which contains a list of pointers to a class A. That list must only be modified by C methods, hence it's private. Still i'd need to...
[5 replies] Last: No, returning a reference to a member variable doesn't create a copy. (by gaxio)
by cmisip
Please evaluate and propose a more efficient implementation based on bit operations in a 32 bit machine
 
I am working on raspberry pi3 and it has the ARM cpu which prefers to do memory read and write at 32 bits. I have two processess zma and zmc. Zmc processes vi...
[7 replies] Last: The only architecture I know of where accessing the stack or the heap ... (by helios)
how can read data from file for vector<Mat> variable
 
I have used one sample code from the link below: http://www.cplusplus.com/forum/general/221958/ I can save and load data perfectly for "vector<int>" type. ...
[5 replies] Last: A very crude demo - don't have time for sth. more elaborate. #includ... (by Thomas1965)
module missing
 
every time i open project it tells me a module is missing and it tells me press to compile i press it later says "weapon x could not be compiled.try rebuliding ...
[2 replies] Last: yes (by jflyer215)
can anybody help with this cp ques??
 
...
[no replies]
HOW TO DO IT
 
@tpb @jonnin Can someone explain me how to approach this problem https://www.codechef.com/LOCJUL18/problems/COLCHEF I solved the subpart using maps but gettin...
[no replies]
July 2018 Pages: 123... 9
  Archived months: [jun2018] [aug2018]

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