Beginners - August 2014 (Page 29)

global operator <<
 
Hi If you had to replace the following member function with a (global) operator <<, how would you do that? void print(vector<string> &names, vector<d...
[1 reply] : The operator << has an arity of two: stm << object ; So we need to... (by JLBorges)
by mehak
Class
 
according to me the output of the following program should be 2 and 4 but its not,y? #include<iostream> using namespace std; class Bix { int x, y; pu...
[2 replies] Last: Why are Bix::main and Bix::show creating private instances of Bix name... (by AbstractionAnon)
sorting
 
Hi I have two vectors. One for names and the other for ages. I want to create a new vector to store the ages that match the names after the names have been s...
[10 replies] Last: > error: 'class std::multiset<std::pair<std::basic_string<char>, doubl... (by JLBorges)
by mehak
type checking
 
what is static and dynamic type checking and how does C++ accomplishes that?
[1 reply] : You are spewing many questions of similar nature. Start from some int... (by keskiverto)
Problem with iterators
 
Hi, I wrote a simple program to test equality between 2 containers, but it's not working and I can't figure out why. #include "stdafx.h" #include <ios...
[13 replies] Last: Ok I finally got it working, I think sleeping helps clarifying all tha... (by Geranimo)
by mehak
constructors
 
From inside the constructors and destructors,a virtual call is resolved at the time of compilation.I came across this statement however couldnt understand.
[1 reply] : I came across this statement however couldnt understand. Probably bec... (by Avilius)
by ugonna
block characters and loop program
 
hello guys, i am having some problems with my code (i am an absolute beginner by the way). i am creating a program where the user gives me the input of his "buy...
[no replies]
by mehak
ad-hoc polymorphism
 
what is ad-hoc polymorphism?
[no replies]
by mehak
class pointers
 
why derived class pointers cannot point to base class and why is the vice versa correct?
[2 replies] Last: Hi, One can declare a function that takes a pointer to a base class, ... (by TheIdeasMan)
by mehak
friend function
 
why is it neccessary to define the friend functions outside the class?
[1 reply] : It's not. #include <iostream> class Class { public: Class(int valu... (by Peter87)
hide cin
 
hi how can I hide my cin in console mode, like password?
[4 replies] Last: see: http://www.cplusplus.com/forum/beginner/43683/ (by JLBorges)
Does bit shift operator changes the operands?
 
I am a little confused by bit shift like ">>" or "<<". See following commands: int a = 16; int b; a>>1; b = a>>1; My question is: what is value...
[5 replies] Last: I hadn't thought of that. I recently discovered that boost::path appe... (by kbw)
HELP! I need help understanding this error message
 
My code is supposed to take in a string and return how many words are in the line. The code compiles, however I am receiving an error message that I do not und...
[1 reply] : Problem is line 43: i <= s.length() After you fix that, the next ... (by Smac89)
function pass by parameter
 
int exp_adder( int exp ) { if ( win ) { experience += 20; if( experience == 100 ) //experience and character_level is global ...
[8 replies] Last: okay i learn some techniques about using or making global . If you a... (by xenovia12)
Program-Defined Value Returning Function - 3 Test Scores Averaged
 
This may seem redundant, as I know I have seen at least one thread on this exact topic, but it seemed to vary from what I had, and I couldn't quite get the answ...
[2 replies] Last: Well, as I figured, it was something really simple. And I appreciate y... (by Acidbassist)
pointers, bool types, why doesn't this work?
 
This tiny program is supposed to accept a hard drive as a device, read the bootsignature and verify that it is 0x55AA So far, the bootSignature pointer points...
[8 replies] Last: I would not write a class at all: it is a sideways approah to a rather... (by IWishIKnew)
Is This Possible?
 
I have been making an rpg game that is set in the console @ is player # is wall and so on. but one of the features i was wanting to put into the game i have no ...
[2 replies] Last: thanks. i agree with just having a set number of arrays with a lock. t... (by Antone333)
strstr and finding text in pointer
 
Oops .. disregard. Someone can delete this as there is no point posting this until I work out the logic involved. Thank you
[no replies]
Problem with while loop and variables
 
Hi, i'm trying to build a program to count squares inside of squares (i don't know how to explain better, take a look at the link). The program worked out all r...
[3 replies] Last: The program is fine, woks as expected, but when i tried to add a while... (by VentusiK)
C++ program help
 
Good Afternoon, I am currently in a C++ course and I am having problems with one of my assignments. The question is below (number 4), and then what I have is...
[1 reply] : If your whole program is in one (cpp) file, then why are you linking t... (by keskiverto)
August 2014 Pages: 1... 2728293031... 40
  Archived months: [jul2014] [sep2014]

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