Beginners - October 2010 (Page 24)

Text file reading: separate string using vector and structure
 
Hi C++++ forum, I'm writing a program to read a text file which has the following format Number of data points 12 Number of places 6 1990-01-01 1 25.002...
Oct 14, 2010 at 9:46pm
[2 replies] Last: Thx Galik. It works perfectly now (by thecatalyst)
Input ignore
 
please i just started on C++ 2 weeks back and have got assignments. if i do not declare a variable and need to use cin to declare it and have used the if comman...
Oct 14, 2010 at 9:37pm
[2 replies] Last: This one is better. http://www.parashift.com/c++-faq-lite/input-outpu... (by kempofighter)
Displaying array
 
For a school assignemnt we need to make a little console game. Its there a way to display a 2d array in it's array form like so: xxxx xxxx xxxx xxxx ...
Oct 14, 2010 at 9:02pm
[2 replies] Last: Use nested loops (by Bazzy)
virtual inheritance
 
some of the output for this program is missing, after everything the name address, Date, etc The Pay is the most important,It is supposed to out put everything...
Oct 14, 2010 at 7:13pm
[1 reply] : This is the code I wrote: #include <iostream > using namespace st... (by hallux2003)
by wasabi
Member functions and variables
 
I've been working on a class project for a few days now where I need to modify and improve a program given to us by the teacher. The program mostly relies on a ...
Oct 14, 2010 at 7:09pm
[9 replies] Last: +1 Athar (by Disch)
Stupid Calculator Program
 
Okay, so I'm trying to make a program here that performs completely unhelpful variants of normal math functions, for example: 2 + 3 = 23 2 - 3 = 32 2 * 3 = 2...
Oct 14, 2010 at 6:53pm
[2 replies] Last: I'd say char ch; cin >> first_number; do ch = cin.get(); while(... (by hamsterman)
Word counting program
 
I am trying to create a word counting program and cannot. This is what I have so far: #include<stdio.h> #include<string.h> #include<iostream> #def...
Oct 14, 2010 at 6:43pm
[2 replies] Last: It does not count the total number of words in any sentence that I imp... (by wasmin11)
countdown();
 
Im trying to create a countdown function after I drew the numbers using DrawLine from 9 to 0. The numbers are all on the same location on form1. I want them to ...
Oct 14, 2010 at 5:21pm
[no replies]
by Eyecon
If statement prob.
 
Im a beginner as you can see below have written the following code : #include <iostream> #include <string> #include <stdlib.h> int main () { using ...
Oct 14, 2010 at 5:10pm
[1 reply] : I don´t know why y/n are 1/2.. But you should do if(y=='y') //note t... (by kaduuk)
by wtf
Yay! I spent all day yesterday and much of today rewriting my matrix class
 
changing to a () indexer instead of a indexer only to find that the following code will no longer compile : work. void sudoku::cleargrid() { f...
Oct 14, 2010 at 5:09pm
[6 replies] Last: well does that explain why it would work as expected before I had chan... (by wtf)
c++ program why this output?
 
Hi I wrote the following program is Vs2008, c++, console application #include "stdafx.h" #include <iostream> #include <iomanip> using namespace std; ...
Oct 14, 2010 at 4:44pm
[2 replies] Last: Ok I found it My program works if #include "stdafx.h" #include <i... (by mariolopes)
LNK2019 error (conversion program)
 
I'm getting the following error when trying to build this program (converts inches/pounds to centimeters/kilograms), and I'm not really sure what I'm doing wron...
Oct 14, 2010 at 4:34pm
[1 reply] : You didn't implement void convert(int height_in_inches, int weight_i... (by Null)
Designning classes
 
The main function looks so messy. I am wondering if there is a way I can move some of the code from the main function to Student.cpp. Could anybody help plea...
Oct 14, 2010 at 4:09pm
[1 reply] : I created another function within the main, and moved the loops in the... (by yingkang)
int main() vs int main(int argc, char *argv[])
 
Why does the C++ tutorial for this site not mention ANSI C++ standard int main(int argc, char *argv ) function. Instead it uses int main(void). What is the d...
Oct 14, 2010 at 3:58pm
[3 replies] Last: For a basic tutorial such as that on this site, then adding in more de... (by Pax)
How can I call a a function to scan a character and return the value?
 
I have already made the majority of the program, what I am trying to achieve is removing the character scan from the main function and bring it out in order to ...
Oct 14, 2010 at 3:55pm
[no replies]
making your own namespaces
 
Hello, I'm creating my own namespaces and I had a quick question which I can't seem to answer. The code below is an example of two namespaces I wrote to grou...
Oct 14, 2010 at 3:18pm
[3 replies] Last: I use it in the most local scope that remains convenient in source (.c... (by moorecm)
by ToniAz
Swapping 2D vectors
 
Hello everyone! If we want to swap a 2 1d vectors we would write: #include <vector> vector <int> v1; vector <int> v2; v1.swap(v2); Now, if we ha...
Oct 14, 2010 at 2:56pm
[2 replies] Last: vector<vector<int> > v; //2d vector v ; //one row (a vector) vector... (by ne555)
cout and '\t'
 
i'm printing out a bunch of values of differing length to the screen but want it to look nice. i can use -- cout << '\t' << values << endl; BUT the tab distan...
Oct 14, 2010 at 2:34pm
[1 reply] : See decision here. You can use spaces instead of tabs. http://cpluspl... (by alx49)
Subset of list of objects
 
I have defined my own object type myClass , and in another class I am storing a list of instances of these objects. I have written the method below to return ...
Oct 14, 2010 at 1:15pm
[4 replies] Last: Oooh, thank you! That seems to work now. I did try to switch over to... (by kamikazeUnicorn)
countdown();
 
Im trying to create a countdown function after I drew the numbers using DrawLine from 9 to 0. The numbers are all on the same location on form1. I want them to ...
Oct 14, 2010 at 12:50pm
[3 replies] Last: What's with the ^ ? Is Pascal haunting me? As for the problem, you're... (by hamsterman)
October 2010 Pages: 1... 2223242526... 42
  Archived months: [sep2010] [nov2010]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.