Beginners - March 2010 (Page 21)

Array MinMax Function Problem
 
I have the question: Write the definition of a function max that has three int parameters and returns the largest. My attempt is does not work properl...
[6 replies] Last: Bingo. My way was: if( a > b && a > c ) return a; ... (by jsmith)
c++ arry question
 
just wondering why does this not work ? I want to figure out the size of an array of a strut but it just returns 0 #include "stdafx.h" struct OBJECT { ...
[4 replies] Last: You have to make the size known or else pass in the number of elements... (by jsmith)
can I define this function as a member function?
 
ostream& operator<<(ostream& os, Input_win& w) { return os << w.value(); } I would like to define the above function within the class Input_win. Can...
[8 replies] Last: Got it--and I just read an explanation on wikipedia. Thank you, so muc... (by closed account iw0XoG1T)
Output Matrix 2x3 Array & its Transpose 3x2 Matrix Array
 
I have this problem that requires me to have an user input 6 numbers. Then cout these numbers of an array of size = 6 to print out as follow: 6 5 4 3 2 1 ...
[4 replies] Last: Hi, perfect...that works...thanks a lot (by rapduty)
Logic Error: Simple Test Grading
 
So here's my problem. I've written a simple program to ask three questions, store the user's answers into variables, and then used conditional statements to see...
[7 replies] Last: for the fail. FYI, it's for the loss (FTL). If you really REAL... (by firedraco)
functions
 
i have this practical assignment due tomorow heres the question for the prac : Write a C++ version of the game called BEAT THAT! In this game, a player will ...
[4 replies] Last: Look up some sorting algos online, they'll be more reliable than that ... (by tummychow)
C++ Keyboard
 
Im having trouble with this problem. I have to write a C++ program that reads in 10 numbers from the keyboard and then add them together. Then, finally print...
[6 replies] Last: Don't double post. Your question should be posted exactly once across ... (by tummychow)
map suddenly contains null pointers
 
Hello all, I have a class DeviceManager in which I have a global variable as follows: ... map<long, Device *> devices; // global variable ... // Def...
[8 replies] Last: Fair call j, I agree that initializer lists are better. Once you've... (by sammy34)
overload
 
Im having difficulties understanding overload operationd especially with objects & pointers. So i need to know which book did you guys use to understand this c...
[1 reply] : Function (and operator) overloading is nothing more than writing two o... (by jsmith)
by D002
wrong code
 
what is wrong in the following code ?? #include<iostream> #include<fstream> #include<cmath> #include<iomanip> using namespace std; int main() { int...
[5 replies] Last: What kind of output are you getting? if the numbers are written as... (by trostemd)
by JoshMP
Passing an array into a function
 
I'm trying to pass an array read from a file to a function. I'm getting an error message saying "no match for 'operator<<' in std::operator<<" Here's my cod...
[1 reply] : Function output2 is void. It doesn't return anything. Yet you are tryi... (by hamsterman)
trouble with pointers
 
i'm working on a txt based game i have a seperate header and im getting this error... .here's the code ill post the error at the bottom // World System ...
[4 replies] Last: World* GetObject(int index) { return WorldList ; } thats ... (by L E G I O N)
Changing fifths to tenths
 
Hi. I'm new here and new to C++. I'm writing a program which analyzes a race horses pace performance. The data I get is formatted thus: i.e. second call ...
[2 replies] Last: Sorry jR. I figured it's a basic newbie question, but perhaps someone... (by smilingTiger)
cin not ending
 
Hello i'm quite new to c++ and have written a simple program that will decipher some text based on a transposition cipher. However my problem is that cin takes ...
[5 replies] Last: I just tested it. It works. ^Z or F6 followed by <enter> (by kbw)
Passing a 2d array...
 
I'm trying to pass a 2d array into a function to modify it... But it doesn't really work. here is where I call drawCar: //inside main function playerCar...
[4 replies] Last: Right so your car is 3x3 but you're only drawing it to a 1x1 space. ... (by adikid89)
problem with STL
 
Hello everyone.I'm practising STL and i runned into some problems.What i want to do is a deck of cards and so i defined a class with a deque as a private mem...
[1 reply] : Line 9: you can't initialize the object at declaration. Line 11: wr... (by jsmith)
leading zeros
 
I have a simple question. I'm using a class that inputs time (my_time, your_time) in terms of hrs:mins. I've got the whole program figured out except for one ...
[4 replies] Last: I don't see how leading zeroes on input is a problem. It should work ... (by jsmith)
Good practices with loops and counters
 
Hey All, Is it a good practise to perform certain operations in your code based on the count value obtained from a complicated for loop? For example, lets sa...
[4 replies] Last: Not sure if this is what you're talking about, but this is stupid: ... (by jsmith)
easy question???
 
Hello guys, i would like to ask you about c++ language. i have an assignment and i want to do a movement for the hero? i have an assignment and i want to do a ...
[5 replies] Last: Oh! too fast left_room as variable and left_room as function could ... (by moritz)
by dbaby7
Calculator
 
Hi guys, Im trying to write a calculator in c++ to improve my skills but I've come across a problem....I read the type of calculation the user wants to perform...
[2 replies] Last: Thanks I didn't know how people were inserting code like that! I just ... (by dbaby7)
March 2010 Pages: 1... 1920212223... 34
  Archived months: [feb2010] [apr2010]

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