Beginners - August 2011 (Page 15)

by tonnot
Create a vector, pass by value to an object and use it, or use a public vector instance of object?
 
It is a doubt I have from the beggining og my C++ learning. I have a main class and I have a object that has the capability of fill a big vector. What is best...
[3 replies] Last: 1.- Create vectors, pass to a classB by ref, use it from class A . 2.... (by Athar)
Typed text
 
How can i get the text that is printed on the screen look like it is being typed by someone else. Kinda like how it is on Pokemon games or similar. This is ...
[1 reply] : if you just mean printing one character at a time, put the text you wa... (by quirkyusername)
Class name not being Identified by the program
 
I was making a text based game in the console. I designed a class named Player in a file Player.h and a class named Moves in another file named Moves...
[5 replies] Last: Done that. That worked Great. Many, Many, thank. (by Nisheeth)
Having some trouble
 
I wrote this code to automatically call the U.S. based on the area code of the phone number, but can't figure out what the error means. >#include <iostream> ...
[3 replies] Last: cin >> phone; does not allow spaces and dashes. Or do you mean that y... (by coder777)
what did i do wrong? with classes
 
what did i do wrong, it bypasses all my if's and go through memeber function stat() and then goes to inventory(), and in stat() it does not give acurate numbe...
[7 replies] Last: The store class is to represent a store where you can buy items . S... (by closed account 1vRz3TCk)
TNT Array2D
 
Hi all, This is a part of the header file of the TNT 2DArray class: template <class T> class Array2D { -Data -Many more methods and these two: T* o...
[4 replies] Last: Thank you very much, I get the point! (by chucthanh)
keeping an iterator to the last "used" element
 
Dear all, I would like to "keep trace" of the "last used" element in a STL container, and I would like to understand what I should expect if the container ch...
[2 replies] Last: IIRC, std::map iterators will still be valid if you insert or erase el... (by Zhuge)
Main in external .lib
 
I'm trying to have my main function in an static library. I can compile the library just fine, but whenever I try to compile the project that links to the .lib,...
[no replies]
by ksm092
How to match a string from reading from a datafile, line by line?
 
Ok, I have the reading from the datafile line by line sorted, however I have a string that I want to search for in the datafile. This is what I had, however it ...
[5 replies] Last: that is all I have, however it doesn't seem to work.. (by ksm092)
"simple" swap
 
Hey guys, It's been quite a while since I last made a topic :) Well here I am again with a question (about a bigint class). I declared my operator+= as ...
[9 replies] Last: It simply fails because the type of b is different to the type of a. W... (by coder777)
#include ___.h
 
Well first off, this is my very first post on the forums. So hi! :D I've been learning C++ for a while now, finding internet tutorials, reading books, consul...
[2 replies] Last: Thank you, now that I look at this it all seems so simple, especially ... (by yipiyip)
u GUY WOULD LIKE TO TAKE A LOOK AT HARDWARE?
 
Recently I have the chance to be a technician. I need to replace my PC power supply so from there I learn more on the internal. Power supply, cables, floppy dri...
[1 reply] : This smells like an advertisement / ad-bot NOTE: Opening post repor... (by shacktar)
by ksm092
How to make input sentence into one string? or other method?
 
Hey Guys! I am writing a program on C++ with linux that will require the user to use the program by typing: ./contactadd 12 June 2010 Jessica Daniels Descripti...
[7 replies] Last: Oh, Thanks so much!! (by ksm092)
Extract columns of data from input file into single variables
 
I read in an input file with 8 columns of data. I'd like to work with each column of data separately. Is there a way to work these columns directly or do I need...
[1 reply] : You could get each line using http://www.cplusplus.com/reference/iostr... (by James Burnby)
by chipp
syntax questions
 
what's this mean INPUT input = {0}; and test test1 = {}; //test is a name of a structure does it mean like: //default constructor of test t...
[4 replies] Last: Out of interest, with which compiler? (by andywestken)
by BaltaX
Program invokes copy constructor when I thought it should invoke assignment operator=
 
In the following program file (which tests a homegrown string class called String, see code below), the row str2 = str3 + str1; //Denna kallar på copy cons...
[4 replies] Last: Well, the code is good; it's just a few loose ends I'm talking about. ... (by andywestken)
Check if 1 or 2 is pressed
 
This is my code. #include <iostream> int main() { std::cout << "You wake up hanging upside down from your parachute, dangling about 15 feet" <<...
[3 replies] Last: For a simple example of an 'cin' command to illustrate (because i am b... (by PracticingProgrammer)
4D matrix with one non-constant dimension
 
I am having trouble figuring out how to create a 4D matrix in c++ with only one variable, and 3 constant dimensions. I am trying to create the matrix B ...
[8 replies] Last: Update: I've been using this constantly in my code. This is so much ea... (by FzzPoofy)
Zero at end of pointer!
 
Hi, I am having a problem with a pointer. My pointer pn_eles is properly initialized filled with integer values, so that when I run this fragment: ...
[2 replies] Last: I figured it out! There was a problem with something completely differ... (by FzzPoofy)
Operator Overloading
 
What is wrong with my code snippet? #include <iostream> #include <ostream> #include <iomanip> using namespace std; class X { int Number; publ...
[2 replies] Last: Thank you, Solved. (by Vikram Narayan)
August 2011 Pages: 1... 1314151617... 39
  Archived months: [jul2011] [sep2011]

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