Beginners - August 2008 (Page 5)

How to add STL object as member?
 
I would like to build a class having a set of integers: set1.h -------------------------- #include <set> class set1{ set<int> integers; ... }; -------...
[4 replies] Last: However, I would prefer some extra typing to some extra debugging... n... (by exception)
Getting to grips with wstring
 
First the basic question, (I) I'm using the following code, trying to print the 'á' character over the console without much luck (instead it prints a different...
[3 replies] Last: Hmm, I'm sure I did this before... But it must have been something ... (by Duthomhas)
Copy Constructor
 
Hi all, While using a copy constructor we are passing a const reference as parameter for the constructor. Why can't we use a pointer instead of referen...
[3 replies] Last: the reason is because when you use a reference it´s become more easy ... (by grecoman)
loop for sum...
 
How to write a for loop which sums all values between 10 and 100 into a variable called total? Assume that total has NOT been initialized to zero.
[5 replies] Last: Given a list of numbers (any list will do, so my example will be short... (by Duthomhas)
Main Loop Question
 
i was just wondering why most people use int main() and then return 0. why not just make it void main(). is it just good practice or for the "fun" of it. I real...
[4 replies] Last: The standard states clearly that main has to return int. Otherwise you... (by exception)
by hurryo
problem in copying file
 
#include <iostream> #include <fstream> main() { ifstream a; int z,n; char ch; a.open("dta.txt"); a.get(ch); n=1; while (!a.eof()){ while (!a....
[5 replies] Last: How does it not work? The string getline() function is designed exactl... (by Duthomhas)
2D Arrays(Manipulation)
 
Hi I'am new to programming and i need help concerning 2D arrays. If i read in data values from a file and stored these data into a 2D array. How can i manipula...
[3 replies] Last: To add up the numbers you want, just think of how the indices change a... (by mahlerfive)
by yuyan
a bit confusing!!!
 
i am asked to write a program that reads in two arithmetic operators and a desired calculation result from those operations. The program will then search for co...
[1 reply] : sum = a operator_1 b operator_2 c; You can't do that... You must... (by Mitsakos)
Assignment question
 
This is my assignment : Title: Phone Book Directory Draw a flow chart and write a complete program of a phone directory book. The program must be able...
[1 reply] : This is the sort of question you shoudl be asking the person who set t... (by Faldrax)
Console Text Colors
 
So i know of two ways of changing the text color of a console application. 1.) system("color #"); 2.) #include <windows.h> HANDLE hColor; h...
[3 replies] Last: ok, i was just wondering if there was any better ways too do it. thank... (by kartracer12)
by tyler
word/text twist program, assistance required (1,2)
 
i need to make a program which reads from a file which has a word list. i then need to input more than 3 letters, and less than 8, and then see how many words w...
[26 replies] Last: Using Duoas solution with the find_first_not_of() and the count() fu... (by Mitsakos)
by kacko
Linux windows.h
 
What is a comparable library for creating forms on a linux OS?
[no replies]
I know where the problem is just dont know how to fix it.{still in need}
 
I've been trying to figure out how to conduct a merge sort and been having problems Here is my code with out the sort and it works fine. If some can give me a h...
[11 replies] Last: Yes the sort does work. I ve used those sorts in previous programs and... (by tdigdug)
If else problem
 
//Subtraction program - Brian Story #include <stdlib.h> #include <iostream> using namespace std; int main() { int a, b, c, d, score; //Setting a, ...
[7 replies] Last: that program works fine but you may want to only seed the program once... (by kartracer12)
what did i do wrong?
 
#include <iostream> #include <conio.h> #include <math.h> using namespace std; int n; int i; int b; int main () { cout << "enter a number and this p...
[9 replies] Last: Well i thing this code can help you #include <iostream> #include <... (by grecoman)
getch problem
 
#include <iostream> #include <conio.h> using namespace std; bool redo(); int main() { top: cout << "Hello, world!\n"; redo(); if(r...
[5 replies] Last: Oh, mahlerfive. Stupid me. (by QWERTYman)
ordering a map
 
If I have 2 maps like .. map <int, int> X; map <int, int> Y; .. and they holds coordinates for drawing something, like a house. The data looks like .. ...
[8 replies] Last: Not really, no. The ycoord iterator would always be dependant on the x... (by Duthomhas)
Appending to a string won't work twice in a row.
 
I'm trying to simply append 3 strings together into one string, but I can only get append to be successful once. I thought that there may be some kind of issue ...
[16 replies] Last: That just invokes a self-assignment. The first way is fine. :-O (by Duthomhas)
Bus Error
 
I believe that a Bus Error is a problem with the program trying access memory it cant. I am not sure what i'm doing wrong. I believe its coming from the strcpy(...
[2 replies] Last: Ya that worked thanks (by bluegray)
by KgNe
A problem with cin!
 
Well, I'm a beginner in C++ and I tend to make MANY errors when trying out codes I'm not taught before. So recently I got to know about GetAsyncKeyState and i u...
[1 reply] : We can't help without code. However, I suspect that you are getting in... (by Duthomhas)
August 2008 Pages: 1... 34567... 14
  Archived months: [jul2008] [sep2008]

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