Beginners - September 2009 (Page 2)

School project stuck on it
 
hey, I just started taking c++ and did the first couple projects ok but this one has me stumped. a large company pays salespeople on a commission basis. The sa...
[2 replies] Last: Haha chrisname, you really hate for loops:D BTW, std::cin >> (...); ... (by R0mai)
by JRevor
What does this prototype mean?
 
I want to overload the operator = (assignment). The header/prototype the overloading function is supposed to look like this (according to wikipedia) Type1...
[1 reply] : What does 1&, and 2& mean? It doesn't mean anything. It's not 'Objec... (by helios)
by Zayro
DungeonMan (first game)
 
Alright, I just finished the basic engine for a game I'm making, called DungeonMan. Right now, it runs in the terminal and doesn't accept user input, just simul...
[2 replies] Last: Also read up on classes and object oriented programming. (by Return 0)
How to pass paramter to exported dll function?
 
{ MsgFunction gethostname(0); hinstDLL = LoadLibrary("wsock32.dll"); if (hinstDLL != 0){ gethostname = (MsgFunction)GetProcAddress(hinstDLL,...
[no replies]
by robezy
How do I use accumulate from STL
 
Hi, could anyone tell me how to use accumulate from STL. I get following error when I compile. Bonuses.cc: In member function ‘std::vector<int, std:...
[4 replies] Last: Thanks......!!! (by robezy)
confused with working with <fstream>
 
So i have to make a program that taken in 12 temperatures and it will write out to "tempdat.dat" and the temperatues will be displayed vertically and the differ...
[4 replies] Last: great, that did the trick, thanks for the help (by pancakespat)
... I am just not getting it ...
 
Write a program that calculates and prints the bill for a cellular telephone company. The company offers two types of services: regular and premium. Its rates v...
[1 reply] : And your question is...? (by helios)
by GDog63
Age program advise
 
Can anybody could help me in modifying this program? It asks for the user to enter his/her age. When the input returns it displays a message. However I wa...
[9 replies] Last: You need to check !cin, not !age, and that ';' isn't supposed to be th... (by firedraco)
void Function Problem
 
The compiler keeps giving me the error: 6a.cpp: In function âint main()â: 6a.cpp:59: error: expected primary-expression before âintâ I don't know what t...
[3 replies] Last: GetNumTickets returns void (i.e., nothing), so you can't assign it a v... (by firedraco)
by wtf
How to get digit count of an int?
 
I tried the following code but noticed that it is a bit slow. Any suggestions on how to improve it? int count_digits(const int d) { int place = ...
[1 reply] : Scrap that and rethink. Given any positive whole number, the number... (by Duthomhas)
generating random values
 
hello guys it's been a long time, i have a problem, i need to generate random values, but these values need to be coordinates (x,y) i would like to hear idea...
[4 replies] Last: use srand() to seed your random. also, use code brackets so that i... (by mspy2plus)
Assigning user input to a private data member.
 
//Class definition filler here private: int digit; //main function cout << "Enter a digit: "; cin >> ??? How would I get cin to assign what the ...
[3 replies] Last: Thank you very very much to the both of you. This really helped me ... (by MrFiddleSticks)
by hannes
#ifndef
 
What is wrong with the following lines of code? the header file is called: vergelijking.h #ifdef VERGELIJKING_H_ #define VERGELIJKING_H_ #endif ...
[15 replies] Last: it was a fault with my environment. anyway, many thanks! (by hannes)
RunTime error
 
I'm baffled. I know where the problem line is. I just don't understand the problem except to add that it likely relates to either pointer or reference or both...
[no replies]
by baross
start in not passing to the function...how do I make it work.
 
#include<iostream> #include <cmath> #include <iomanip> using namespace std; double VelocityCalculation(double initialVelocity, double time) { ...
[no replies]
bool
 
...should work in plain old C, right? Sorry for posting a C question in this forum but I like the C++ crowd better...
[2 replies] Last: It works if you #include <stdbool.h> I believe. (by firedraco)
by JRevor
Problems with copy constructor and dynamic memory
 
I'm working with a dynamic vector class, called Vector. It has two attributes : longitud (which is the length) and p, which is a float pointer. Here's the co...
[5 replies] Last: Thank you so much helios. I think I'm in debt with you. (by the way... (by JRevor)
How to determine non-vowel in a string and display it out???
 
I know how to determine vowel in a string but i not sure how to change the code to make it determine the non-vowel in a string and display it out... Anyone got ...
[9 replies] Last: Could you not approach it differently: char vowels = {'a', 'e',... (by mcleano)
by franco
Segmentation Fault problem in removing an element from a double-linked list
 
Hi! I'm fairly new to this website. I've been encountering a segmentation fault error with the code below. I'm developing the methods of a double-linked lis...
[no replies]
inlcuding a class multiple times
 
Hi, i'm a real beginner with c++, and i've got some problems with compiling my project (I'm using g++). The problem is as follows: I've got a class sha f...
[1 reply] : Maybe you are indeed missing a ';'. Can you post your code. (by kbw)
September 2009 Pages: 1234... 23
  Archived months: [aug2009] [oct2009]

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