General C++ Programming - December 2014 (Page 25)

Multiple copy constructors
 
Hi, I'm building a non-templated weak pointer type, similar to boost::any in that it knows the type of the underlying value it points to, except it does not ...
[4 replies] Last: Thanks! After some thought I decided to ditch having a const Reference... (by wcassella)
Files and Structures
 
The input file, p5in.txt, contains the following records: 76606 68 80 88 74 72049 89 95 93 97 73338 70 89 95 99 71836 57 51 65 64 75739 64 67 71 76 ...
[1 reply] : //teacher said this had to be in the main I have no idea what to do w... (by wildblue)
C++ Exercise
 
Hi. I am relatively new to programming and need help with a problem from my book. It is: In this exercise, you create a program that calculates the average...
[11 replies] Last: Thank you very much for your help and patience with my lack of program... (by tjaduffy)
Fail to open / create a file
 
Hi, When I write the Ctor as follows, I get an Error: Invalid Sharing Flag 0 (That happens when file exists or does not exist) File::File(const string& file...
[1 reply] : ifstream::open takes 2 parameters, not 3. http://en.cppreference.com/w... (by MiiNiPaa)
Need help building a board for a game
 
Hello guys, i'm making a battleship game on devc++ i got all working so far as i wanted, but now i need to make the game better and apply a goodlooking board to...
[no replies]
by W DR
MCU/PLC
 
I am wanting some info on interfacing C++ with either a MCU or PLC. Basically I want to use a GUI to get info, use the info to either control a circuit or progr...
[6 replies] Last: Much appreciated! (by W DR)
c++ hangman game
 
I modified my code so it would be simpler I just want to know how would I put a limit so it would only have 6 times to guess if the does guess by the 6 time you...
[1 reply] : You could check the current count of misses before starting another ru... (by wildblue)
Reading file with delimiter - storing data to object
 
I am trying to read a file use the data line by line to create into an object. The current file I have is like this and the code reading the file will be fou...
[5 replies] Last: Thanks Tipaye This is the code I used in the end for anyone else try... (by misheck)
by dkaip
a math problem
 
I have a number, for example 7 2^0+2^1+2^2=7. There is a routine that gives the 0,1,2? If i have 6 i must take 1,2. With one number i can have many.
[2 replies] Last: Use binary, 7 = 0000 0111 ( pos -> 7654 3210 <- ) ... (by nightmaregiba)
Listing and analyzing data from a file
 
Hello! I am a novice programmer and I'm having trouble with one of my exercises. I need to create a program that reads the student information (SSN, First & la...
[no replies]
A strange effect of COUT
 
Hello every body, In the following code the function 'fun' sets 'x' to the value of 'norm' which is NOT properly initialised. In the presence of this bug t...
[1 reply] : Because you are using uninitialized variable norm which is undefined b... (by MiiNiPaa)
Linux (OS in general) and C++ (Prog Lang in general)
 
How programming language uses OS to achieve solution or software goals? I am not talking about g++ compiling directive or things like that, but how OS is used i...
[2 replies] Last: Oh! they are so busy and their answer is very professional, but not mu... (by csstudent123)
Class.h is having issues with virtual functions
 
I'm writing a class "Property" for a program that manages different types of properties. This is my .h for y base class. I was trying to write a virtual void fu...
[1 reply] : Paste whole class definition here. There is too little information to ... (by MiiNiPaa)
by CSC121
Lowest Value In Vector Problem
 
I am to write a program where the user is to enter a 5 or more values into a vector and it will output: *the list of values in the same order as the user enter...
[1 reply] : #include<iostream> #include<vector> int main() { std::vector<doubl... (by mutexe)
unresolved external
 
// Heap // Demonstrates dynamically allocating memory #include <iostream> using namespace std; int* itOnHeap(); // returns an it on the heap void le...
[2 replies] Last: Cheers! (by NewCComer)
by rossb
vector of vectors
 
I am terrible with creating "matrices" and was hoping someone would help. How would I make this vector of vector? 30 30 30 30 30 30 20 20 20 30 30 20 10 20 3...
[1 reply] : std::vector< std::vector<int> > matrix = { { 30, 30, 30, 30, 30 }... (by JLBorges)
Is it good practice to return different variables based on the parameter value?
 
Say I have a GetSomething(char type) function which returns two different variables based on what you pass it, like so: float Flashlight::GetSomething(char type...
[3 replies] Last: > What is wrong with a float versus a double? double is the natural... (by JLBorges)
by Aliff
Computer graphic opengl c++
 
Whats wrong whit this? #include <iostream> #include <stdlib.h> #include "imageloader.h" #ifdef __APPLE__ //#include </usr/local/Cellar/glew/1.10.0/...
[1 reply] : You'll either need to use "" rather than <>, or add it to the include ... (by TwilightSpectre)
Hey there need experienced help with something lol
 
Hey there, for my final eportfolio in one of my classes we created a site for it using google sites. I want to make it so when the evaluators hover over some ...
[no replies]
Using variables to access objects in a windows form.
 
Alright, so I'm making a windows form with a few hundred buttons, and one button will change color based on data the program receives over a socket. This is wh...
[3 replies] Last: You need to declare an array of buttons in the class, obviously. (by helios)
December 2014 Pages: 1... 2324252627... 31
  Archived months: [nov2014] [jan2015]

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