Beginners - June 2018 (Page 17)

istream input loop
 
Hello. If you enter the wrong data in the code, for example, two words through a space, then the input is looped, the loop works and is not blocked where the "c...
[4 replies] Last: Thanks again. All the best to you. (by moskitos80)
overloading << why as a friend?
 
Hi guys, have been meaning to ask this question for a long time,I have done some research and seen some articles on stackoverflow but still can't seem to fig...
[2 replies] Last: but still can't seem to figure out why we must make operator<< a frie... (by jlb)
illegal else without matching if
 
Hi friends How to solve illegal else without matching if #include <iostream> #include <conio.h> using namespace std; int main() { char ch; cin >...
[1 reply] : else if (ch == 'g'); There should not be a semi-colon at the end of ... (by Repeater)
by H00G0
How do you reference class object inside said class constructor?
 
Hello! Okay assume you have a class: class Foo { private: int a; int b; public: Foo(int argument); ~Foo(); f...
[7 replies] Last: @keskiverto My bad I was going to post the whole code but I had to go... (by H00G0)
by Dvx70
Read & write in a file at the same time
 
Write your question here. Hello to everibody...7 My problem is to read and write, at the same time, a text file stream. I have heard about the class file fst...
[4 replies] Last: a stream and a file are not the same thing. your hard disk is incapab... (by jonnin)
Strings
 
- run it and enter your first name, - run it and enter your full name – use space(s) - modify the program so that the string “name” contains your full n...
[1 reply] : Hello procppgram, First <iostream> and <stdio.h> are about the same. ... (by Handy Andy)
by Ma92
reference returing funiton
 
Where we can use reference returning function . and how? like defined. inr& REFFUN(int jak){ return jak; } or object & refobjfun(object obj){ ...
[1 reply] : Both of your examples are returning a reference to a function's local ... (by kbw)
by big co
Problems with class name
 
I'm very new to classes and don't understand the problem I'm having here. I can write other code with classes and they run fine. I'm getting 4 errors; Circle no...
[5 replies] Last: I could call the functions just fine that way before I created the cl... (by Repeater)
Strings
 
Hello everyone, im having problems working on these questions, any help is much-appreciated Thanks Q1 Dimension three 4 x 4 matrices. Read from the keyboa...
[1 reply] : http://www.cplusplus.com/doc/tutorial/basic_io/ http://www.cplusplus.c... (by keskiverto)
Printing heap vs printing array?
 
I'm writing 2 print functions for a heap class, but I'm having difficulty understanding the difference between these 2 functions void displayHeap(ostream& ou...
[2 replies] Last: > but I'm having difficulty understanding the difference between these... (by JLBorges)
Looking for Peer Reviews on Game Code (1,2)
 
So I'm working on a personal project with the goal of developing a sort of survival simulator. I've been taking the minuscule step of creating its first form as...
[21 replies] Last: I figured I'd take a break from trying to improve the menu code and fo... (by CyberSama)
Templates
 
Hi guys I am only learning about templates now,I decided it really is a must,I know many programmers don't choose to learn it,but since the core library in c++ ...
[3 replies] Last: On a double-plus side I learned a couple of things about templates whe... (by closed account E0p9LyTq)
by H00G0
Dynamically allocating class object with constructor arguments
 
Hello people! I have a quick question. Let's assume you have a class which constructor takes an argument Foo::Foo(int) {...} Now let's say you want to dyna...
[2 replies] Last: Oh thank you for the reference, that helped. I wasn't able then, to te... (by H00G0)
by ericM
inheritance from a template base class
 
Hello, I am writing the skeleton for an algorithm following the Strategy pattern presented in a plethora of c++ books, although my compiler does not like the...
[2 replies] Last: Non I dont, and that solves my issue. (by ericM)
Templates and compile time Vs run time
 
This question kind of relates to both templates and how they relate to compile vs run time, so with a lot of compilers you cannot create an array on the stack ...
[10 replies] Last: thanks guys :) (by adam2016)
by koopey
Move all zeros to end of array
 
can't figure out why my code isn't showing any output. any help will be appreciated. the question is: Given an array of random numbers, Push all the zero’...
[10 replies] Last: The single erase approach requires: 3 4 0 0 2 0 6 9 # move 5 elements... (by keskiverto)
by jony11
Need help..Print the verbal equivalent
 
Write your question here.Write a program that input are integer number from 1 to 1000 and prints the verbal equivalent,Example "512" will be "Five Hundred Twelv...
[2 replies] Last: Bro keskiverto two days now i hv been trying my best to think bout th... (by jony11)
problem at excercise with loops.
 
so the excercise is this: a football team has between 12 and 15 players.we must insert some information on these players.The standard for a team is to have 12 ...
[1 reply] : Hello and welcome! Please specify what your problem with this particu... (by Misenna)
how do you atttach 3 objects attached to each other?
 
yeah it looks pretty cool, but I haven't the foggiest idea how its done... else { if( wnd.kbd.KeyIsPressed( VK_RETURN ) ) { isStarted = tru...
[6 replies] Last: The member access operator? #include <string> #include <iostream> st... (by keskiverto)
How to combine this two porgrams
 
How to combine and run thia two program #include <iostream> #include <string> using namespace std; int main(){ string username = ""; string pass...
[no replies]
June 2018 Pages: 1... 1516171819
  Archived months: [may2018] [jul2018]

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