Beginners - February 2011 (Page 8)

Array problems
 
I'm making a program that ask the user for 10 grades so that the program can average it out but I'm only getting 1 as the average. Plus if anyone can explain pa...
[4 replies] Last: const int NUM_GRADES = 10; is preferred to magic numbers, notice ... (by lawfreak)
by lukak
friend problem
 
Hi, I think I have misunderstood friend keyword. I'm trying following: class X { friend class Y; friend void f(){} }; class Z { Y *p; void g(){ ret...
[6 replies] Last: Thank you for your trouble, reps where helpful....I will try to find a... (by lukak)
Beginner's Program Debugging + File Output
 
[Topic deleted to prevent copying by others]
[2 replies] Last: Problem 1: The problem is the while(repeat); statement on line 120. ... (by m4ster r0shi)
Quick parameters question
 
I once learned on here that the point of parameters is so you can pass different values to a function() every time you call it. Because the parameters of functi...
[1 reply] : Is there main purpose to be used to pass different values to a functio... (by TpOreilly)
Trouble with Hangman Game program
 
Can anybody show me how to implement my string for Easy, Medium, and Hard that contain words. By creating a random number and using that random number to retrie...
[no replies]
Meta Data
 
Hello, I'am new to programming, and currently working on a getMetaData function that is suppose to tell you the size of the data and the data Flags that are ...
[1 reply] : Try passing a reference to read: binaryFile.read(reinterpret_cast<ch... (by naraku9333)
array of objects, no default constructor
 
Is there a way to create an array of objects when that object has no default constructor? something like Hand hands (deck) the constructor for Hand cal...
[6 replies] Last: Yes. (by jsmith)
WinMain() (1,2)
 
Hi, in my book its got: int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { static TCHAR szAppName = TEXT...
[39 replies] Last: Ive started a new thread for the previous question: http://cplusplu... (by TpOreilly)
by joe501
Beginner: counting number of vowels; program not working properly.
 
Hi, I am writing a program in which, the user inputs a sentence of 100 characters max ending with a '.'. Then the program outputs the number of vowels found in ...
[4 replies] Last: Many Thanks. My problem is solved. ;-) (by joe501)
Printing
 
const int size = 3; int array ; int n, i, j; /* Fill the array */ cout<<"Enter "<<size<<" random numbers"<<endl; cout.flush(); for ( n...
[3 replies] Last: I mean it's the wrong expression, off by one. Here's how to do it: ... (by filipe)
Rock-Paper-Scissors
 
Hi everyone, I have this rock-paper-scissors game I have to do for my c++ class. We had to use enum type of variable, switch and do while. I had to do the p...
[7 replies] Last: Lol. Loose. Yeah, I'll change that. And as for "paper disproves spo... (by sakurisa)
by Smitty
Finished Code. Can someone verify that is it working?
 
It's my first code. I put alot of effort into it. I just haven't been able to see if it actually works because tomorrow I go the the computer lab to test it. Po...
[6 replies] Last: ahhh thanks for quenching my lust for the knowledge of the planets =... (by ultifinitus)
boost::variant and boost::recursive wrapper issue
 
Hi everyone, I've recently started using boost libraries and im facing a problem. I have the following boost::variant typedef: typedef boost::variant<std:...
[6 replies] Last: Yes. Boost has become a good stress test for compilers :) (by jsmith)
Initializer specified for static member
 
I get the following error. If you could help debug what is wrong that would be awesome. initializer specified for static member function ‘static const csc3...
[3 replies] Last: (Totally aside from the real problem, consider either not providing a ... (by jsmith)
buffer overrun in release build
 
in vc++ 2010 i can compile a release build for a game i made in sfml . i linked the libraries right and recompiled sfml but for some reason i cant create a rele...
[2 replies] Last: My understanding is that the debug build will initialise the variables... (by Zaita)
Converting.
 
#include <stdio.h> #include <iostream> using namespace std; int main ( void ) { const int size = 20; int array ; int n, i, j; /* Fill the...
[5 replies] Last: cin.good() checks whether cin is in a good state which means that you ... (by Bazzy)
output errors
 
#include <iostream> #include <fstream> #include <string> #include <iomanip> using namespace std; void InputError(); struct drinks { long itemno; c...
[1 reply] : Looks like you C strings are not NUL terminated. (by PanGalactic)
resize console
 
hi everyone! Is there some function or something that will resize console window automatically after opening .exe file?? Im using DevCpp thx for answers
[2 replies] Last: ok thx Im going to try :) (by julof26)
"ISO C++ forbids initialization of member" error
 
I get the following error when i compile: ISO C++ forbids initialization of member ‘numIterations’ making ‘numIterations’ static ISO C++ forb...
[1 reply] : Initialize your members in the constructor, preferably in its initiali... (by moorecm)
Problem with Making a Matrix
 
Firstly, here's my code: int *Matrix( NULL ); void MakeMatrix( const int FaceCount = 0, const int ElementCount = 0 ) { if( ( FaceCount > 0 ) && ( E...
[1 reply] : Do you have ElementCount declared somewhere else? (by jsmith)
February 2011 Pages: 1... 678910... 43
  Archived months: [jan2011] [mar2011]

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