General C++ Programming - March 2015 (Page 15)

by yj1214
class private variable error
 
#include <iostream> using namespace std; class Ham{ private: int bar = 1; }; int main(){ return 0; } It says "non...
[3 replies] Last: Someone said I need to add -std=c++0x, -std=c++11 or -std=c++1y. th... (by Little Bobby Tables)
Linked List - being outputed wrong. thank you for the help in advance!
 
#include "function.h" Movie* ReadIn(){ // struct Movie{ // string title; // string leadActor; // string suppActor; // string genre; // stri...
[2 replies] Last: I apologize I had my read in file correct its just when I outputed the... (by Chris Millones)
by glory7
Noah's Ark!
 
Hello, everyone! I'm so sorry to bother you guys with this, but I really need assistance. I have an assignment about Noah's Ark and I really don't get it. Here...
[6 replies] Last: Oh yeah, I totally forgot to include my code, sorry about that. But, o... (by glory7)
Reference to lambda function output
 
In Scott Meyers' "Overview of the new C++11/14", he shows #include <iostream> #include <numeric> #include <vector> int main() { const auto sortedInts = (...
[4 replies] Last: The context of Scott Meyers' example is that such an object, which wou... (by prestokeys)
Program with two functions
 
Please help!! I have to write a c++ program with 2 functions findmax() and getavg(). The function findmax() will print the larger of 2 numbers sent to it and...
[5 replies] Last: Well yeh, thats becuase its written in python and not c++. @yj1214 is ... (by TarikNeaj)
Map - Unhandled Exception: std::out_of_range
 
Hi, I'm trying to implement a function that keeps track of recently used addresses. I've created a vector of maps to assign an incrementing value to each add...
[5 replies] Last: Nevermind, its working. Turns out that was the initialized value befor... (by gradstud)
std::function as member, take functions to either member- or global functions
 
hey guys, I have a class called Button which has a function pointer i want to replace with std::function<>. I can easily use std::function with non-member an...
[4 replies] Last: I confirm, you should use std::ref(a) or std::cref(a). "The arguments... (by S G H)
Purpose of the function?
 
Have worked with this project sometime, and im kinda getting 'blind' on the code. As os know, the problem is, i can't remember what the purpose of the function ...
[2 replies] Last: Ah, thanks, i get it now! I hope you guys can help me out a little mo... (by eskovgaard)
Alternatives for goto statement
 
I have a been in a bad programming practice. Could you guys tell me alternatives for goto statement.
[4 replies] Last: I'll just make 1 block so you get an Idea what you could do // repl... (by Gamer2015)
Inserting a loop in a switch statement
 
I am making a payroll system and i want to make sure that the persons option is well used in this switch statement code below: #include <iostream> #include <...
[13 replies] Last: Im not sure what I am, I havent explored my body in a while. (by TarikNeaj)
arrays and median functions problem
 
Hello guys ! thanks alot for this website it helped me alot...I have a problem with making a median function works with this code...my array takes the data from...
[7 replies] Last: Yeah, just follow the same pattern you used for median. Good luck. (by tipaye)
Infinite Loop when using ifstream::seekg()
 
I'm writing a program where ifstream reads some characters from file, and skips some. However, when EOF is reached, it still tries to read, creating an infinite...
[3 replies] Last: Thanks! It works! (by hakeris1010)
Need help ending my maze game
 
Hi, I need help with trying to end my maze game so that when the character "@" reaches next to F (Finish) which should be at 38,19. The game proceeds to level2....
[no replies]
Tokenizing a string
 
Hi, Say the input has two lines, both of which are "Hello world". This is the output: Hello: 6 world Hello: 11 world: 5 while (getline(cin, line, ' '))...
[3 replies] Last: Obligatory FAQ http://www.cplusplus.com/faq/sequences/strings/split/ ... (by Duthomhas)
by yj1214
Few questions about header file...
 
I'm still learning C++ and there are things that I don't understand about header file... 1. I have 3 files.(main.cpp, Foo.h, Foo.cpp) and this is how I co...
[1 reply] : #1) I answered a very similar question to this in this thread: http:... (by Disch)
by mexbax
How to initialize a defined variable with a type of _IO_FILE?
 
I want to use _IO_FILE and initialize it by a file path. I defined f: _IO_FILE f; but I cannot init it by a file name and then pass it to Func1 which ...
[10 replies] Last: I need to add new codes to provided function. Is anyone has a suggesti... (by mexbax)
"Discovery Dust" item locating function, how could I improve???
 
So I'm making my very first game, I've done decent architecture designing so far or at least I hope. I made an Item class with derived specific objects and I re...
[no replies]
payroll system
 
Please Help me !!! i been making a payroll system in class but their is a problem that i can't solve. 275 1 expected unqualified-id before '{' token this is...
[3 replies] Last: Thanks for your help (by jappreet)
I have a problem about spawn of objects every 2 seconds
 
//I have a problem about spawn of objects every 2 seconds, in my code, it shows //the sprite by blinking every 2 seconds. can anyone help me with this? i want /...
[5 replies] Last: @Gamer2015 I tried that, but still its like blinking. for every 2 seco... (by jb31313)
x86 Assembler stdcall/cdecl
 
hi, here is the program i have so far. i need to implement an stdcall/cdecl subroutine call convention. could someone please show me how to do this, im really c...
[no replies]
March 2015 Pages: 1... 1314151617... 28
  Archived months: [feb2015] [apr2015]

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