Beginners - April 2015 (Page 26)

by enemy
Copy constructor- object not declared???
 
Hello! Please, why is "another" not declared? I wanted to copy first object using copy constructor! Please ignore formula, it is not important! Many thanks!!! ...
[2 replies] Last: Sry, did not meen to post twice, got some error on my own pc s oI pos... (by enemy)
Using std::array in my class
 
Hi! I want to create a class which has similar properties as the std::array container. I also want to make extra constructors and functions in this class. My ...
[7 replies] Last: Ok, I see what you mean. Thank you. (by Alexandr)
by koopey
getline and cin confusion
 
hi. confused with following two questions? 1. can't we use getline for char type? 2. i am confused in this part of the code. char separator; stri...
[2 replies] Last: it worked! thanks (by koopey)
Overrideing operaors... is the the correct way?
 
Override operators #include <iostream> #include <iomanip> friend istream& operator >>(istream& input, Time& inputTime); friend ostream&...
[no replies]
Telling if a number is even or odd
 
Hi guys and garls, why this code is wrong? The output when an odd number is: "#" is an even odd number. But why...? Then when I try an even number it display...
[1 reply] : how about you change your cout? #include <iostream> using namespace ... (by shadder)
by koopey
vector push back with string.
 
hey guys in a program i am writing in one segement, i want to increase the size of vector that contains string. the process i normally use to push_back vector c...
[6 replies] Last: Haha :D While making the game I become kind of good at it so it wasn't... (by Peter87)
Bubblesort is breaking my code, wont run
 
Hi, The below code should run a linear search and then a bubble sort on a family of 4 however i was getting errors i hadnt seen before like this: Unhandled ...
[3 replies] Last: Hi, Sorry for not posting the code properly it is my first time and ... (by molebox)
by SCB3
trying to make a minesweeper array check for mines in a certain selection
 
So, I am making a minesweeper game and I want it to display how many mines are around the players choice like this choice ...
[3 replies] Last: Too advanced? mines_array = { ... }; ... struct coord { int x; int... (by coder777)
making triangle pattern with character
 
Hi guys ! I am supposed to write a program that can form the folowing shape: (N=5) ssssO sssKK ssOOO sKKKK OOOOO ( where s is the space ) and here is the co...
[no replies]
Inheritage between classes and printout
 
I get an error here. Anybody knows what I´m doing wrong. This is new to me and I can use the help. error LNK2019: unresolved external symbol "public: Wha...
[3 replies] Last: You did not implement the 'Mutator Function's setName(...) etc. (by coder777)
by krjeev
why strlen is subtrcting value of i in place of addition.
 
Write your question here. #include<iostream> #include<cstring> using namespace std; class IndiaBix { char txtMsg ; public: IndiaBix...
[1 reply] : txtMsg decays to a pointer (char*) to the first element in the txtMsg ... (by Peter87)
Using "Vector.erase()" broke my program during runtime, Why did this fix it?
 
Prior to a small change, I couldn't get my program to work right. I'm making Asteroids and I wanted to delete ( or "erase") bullets when they leave the screen. ...
[2 replies] Last: Thank you so much (by keanedawg)
by krjeev
Please help me to understnd the output. Why its printing 6 8 and not 2 4?
 
Write your question here. #include<iostream.h> class Bix { int x, y; public: void show(void); void main(void); }; void Bix::sho...
[1 reply] : First, let me establish a bit of notation so I can tell you about your... (by Zhuge)
classes are killing me:(
 
Hi, ever since we hit classes in my intro c++ course I've been flailing. Tried playing with this code that was given in my text book. It worked just as expect...
[3 replies] Last: I can't believe it! I could never get my last lab to compile and that'... (by brosephius)
Can someone please explain what this function does?
 
This is related to stack implementation.... struct SE* pop_st () { struct SE* e = top; top = (top)? top->next: 0; return e; }. Thanks...
[1 reply] : To pop a stack means that you remove the topmost element of the stack. (by Peter87)
by Bocian
converting string to int and checking for a comma.
 
Hello, im in the process of writing a input validation code. But i seem to be stuck on a certain part. For the first part, i need to check that my input has a c...
[3 replies] Last: i still need help, my getname function gets skipped over and i still d... (by Bocian)
Why wont this code run correctly?
 
When you select option 3, nothing happens. Can some one help me with this? #include <iostream> #include <string> using namespace std; int line...
[5 replies] Last: Please edit your post and make sure your code is [co de]between cod... (by LB)
Need help with this Array Question
 
How would I ask the user how many of the searched book they want, and then output the total? I've looked in my textbook, and I can't figure it out. #include...
[no replies]
Template alias question
 
I would like to make an alias for a template, i.e., I have a template A<T>, and I want to refer to it later as B<T>. The following was my best guess, but Visu...
[2 replies] Last: > but Visual Studio 2012 pro says Use a more current version of the m... (by JLBorges)
check if array element value already existed when user input
 
Im a beginner to C++. Its my first year in college. Im completely stuck at this.I have to make a program which takes input 4 strings then check if some value al...
[1 reply] : Are you allowed to use std::set ? It would make this problem very sim... (by LB)
April 2015 Pages: 1... 2425262728... 52
  Archived months: [mar2015] [may2015]

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