49,757 Topics

Member Avatar for
Member Avatar for highflyer8

Let's say you have made a class called threevector which takes stores three doubles. Then you define another class, a fourvector, which stores four doubles. I have seen this syntax used for the constructor of the fourvector: [CODE]fourvector(double fourth, threevector one_two_three): threevector (one_two_three) { fourth = 0.0; }[/CODE] I understand …

Member Avatar for Saith
0
134
Member Avatar for jkoske

I am having problems accessing the members of the base class in my derived class. Is there anything wrong with the way I defined my base class as in: template <class T> class Stack : private Llist<T> Is there anything wrong with that? I am getting errors from gcc in …

Member Avatar for jkoske
0
212
Member Avatar for digitup1

I am trying to time the execution of a quicksort algorithm in C++ but for some reason it constantly returns 0 for me, which clearly can't be right! I don't know where I am gooing wrong, so any help would be greatly appreciated!I have the code done for arrays of …

Member Avatar for template<>
0
187
Member Avatar for benjybob

hi, i have a small problem with the rand operator. at first i tried using it without srand but gave me the same value each time. i have inserted srand(time(0)); but my compiler throws me up these errors: 1>c:\users\ben\documents\university work\year 2\c++\code\myc++\spritelab\asteroidsgame.cpp(17): error C4430: missing type specifier - int assumed. Note: …

Member Avatar for benjybob
0
421
Member Avatar for a.muqeet khan

hello ppl i am a new member of the programming club it been a week since i begin to program and i am doing it persnaly so i am sorry if what i posted is stupid but i want u u guys to have a look and tell me whats …

Member Avatar for a.muqeet khan
0
114
Member Avatar for subith86

Hi friends, I was trying out some inheritance related stuff and found something. I just want to know the reason why. I have a ParentClass and a ChildClass. Both have an integer named [B]commonVar1[/B]. Also both have a getter method of the same name. Here goes the code. [CODE]class ParentClassOT …

Member Avatar for template<>
0
119
Member Avatar for COL_Milkshake

I'm working on a program using heaps and I have a few errors that I can't quite figure out. The first is error C2143: syntax error : missing ';' before 'using' line 2 and the second is error C2011: 'Heap' : 'class' type redefinition line 8 [CODE]#include <iostream> using namespace …

Member Avatar for template<>
0
106
Member Avatar for doraditya

i want a program to remove on;ly excess of spaces if there are more than one spaces it should be reduce to one

Member Avatar for template<>
-2
55
Member Avatar for highflyer8

Hi, I don't understand the need for the while statement. Any help would be greatly appreciated. [CODE]double michel() { double x, y; do // The loop computes points on the graph of y against x. { x = 53.0*rand()/RAND_MAX; // x is the momentum. x is randomly generated. Min x …

Member Avatar for template<>
0
111
Member Avatar for Wakesta

What free C++ programming tools do people recommend? And just to check I would be able to run my programme from this tool?

Member Avatar for Ancient Dragon
0
244
Member Avatar for Mr.UNOwen

Hello, I'm working with a team on a program and freeglut is causing trouble for one of team members. He's the only member working under Windows and he's unable to get the scroll wheel to work. Does anyone know a library for windows that'll read in the mouse wheel input …

Member Avatar for jonsca
0
130
Member Avatar for info04

I want to write a program that asks the user to enter his date of birth and print the zodiac sign on the screen. The program should allow the user to enter his date of birth in the MM/DD/YYYY format. The program should also print the user's age on the …

Member Avatar for CECS
0
2K
Member Avatar for TailsTheFox

Hello, It seems like a simple task, but I can't find a simple answer. How do you find out how much extra space you have on drive "X:\". Is there any simple command like; [ICODE]Size(X:\);[/ICODE]? Or can someone just give me a few lines of code, NOT 53! I just …

Member Avatar for TailsTheFox
0
130
Member Avatar for lelejau

Hello, I have this code: [code] void GetProcId(char* ProcName) { PROCESSENTRY32 pe32; HANDLE hSnapshot = NULL; pe32.dwSize = sizeof( PROCESSENTRY32 ); hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); if( Process32First( hSnapshot, &pe32 ) ) { do{ if( _stricmp( pe32.szExeFile, ProcName ) == 0 ) break; }while( Process32Next( hSnapshot, &pe32 ) ); …

Member Avatar for thelamb
0
493
Member Avatar for avinashganesh

help please... what is the use for double varilabe in dev c++.. and how do u print it on the screen?

Member Avatar for looorin
-2
72
Member Avatar for anu07

Is it possible to do that? If so,can anyone give a theory or something? Thanks :) By the way I am using turbo compiler 3.0

Member Avatar for anu07
0
172
Member Avatar for zack654

I would really want some advanced C++ programmer to answer me this question, so please help me I really need this answer. How can I really start programming with C++? Of course, I still have a lot to lean. I just learned classes and SOME of inheritance features, I write …

Member Avatar for zack654
0
145
Member Avatar for spoon licker

And sorry for double-posting...It's years of frustration and waiting that's compelling me to desperately get an answer here. Thanks for all who are even willing to try and help because I've asked for some tips about this on countless other sites like this and no one has actually helped. I …

Member Avatar for Saith
0
220
Member Avatar for SeePlusPlus2

Not really understanding the concept, why did they use "Person *pPerson = new Person("Susan Wu", 32);" and where did ".length();" come from? Also when "Rectangle *pRect" is put into a parameter, pRect is pointing at the address of the object rect, right? [CODE] #include <iostream> #include <string> using namespace std; …

Member Avatar for rubberman
0
127
Member Avatar for bfprii

I do not understand why the pointer addition is failing. [CODE] char *pipebuf=new char[40001]; CommandRobot *cr= (CommandRobot*)pipebuf; cr->command=2; DWORD *rooms=(DWORD*)(cr+1); *rooms=100;[/CODE] For some reason after executing the value of pipebuf only contains the value of command, it does not contain the value of 100; Yet, when I remove the new …

Member Avatar for Narue
0
153
Member Avatar for Doughnuts

I am trying to add two numerical char arrays such as: [CODE]"124" and "589"[/CODE] I wrote functions to reverse the string and add the strings, and it works for strings like "123" and "456", but when the last digits are greater than 10, I don't know how to carry it, …

Member Avatar for Doughnuts
0
350
Member Avatar for atticusr5

hello all, I am trying to make a menu driven program that uses a while loop and a switch in main. When i choose #1, the code seems to work. However when I type in #2, and enter data, the program goes into an infinite loop, because the menu is …

Member Avatar for WaltP
0
141
Member Avatar for iamcreasy

What happens when I set the value of an integer to NULL? I print it out / debug it, i get the value zero. Even I can use the NULL assigned integer to initiate another integer. Well, then what is the point of being NULL? Why set it to zero? …

Member Avatar for template<>
0
18K
Member Avatar for LloYdZ

can u help me in my assignment: [B]make a program that would display the figure as shown. use a WHILE structure and a method to implement a task.[/B] this is the one i made: please help me what are the missing codes there.. #include <iostream.h> #include <stdio.h> #include <conio.h> using …

Member Avatar for ntrncx
0
89
Member Avatar for DaniwebOS

I'm trying to run this program all together without it being separated into header files and cpp files. Run the program, it just says there's syntax errors. Another problem I'm getting is when the program actually runs, the second event's data arguments don't do anything at all... [CODE]#include <iostream> #include …

Member Avatar for VernonDozier
0
431
Member Avatar for looorin

When I was surfing on an internet I have found four c++ multimedia libraries, which can create games and GUI aplications (SDL, ClanLib, SFML, Allegro). I would like to learn one of them, but i don't have any experience with it. Can you recommend me one of them? I have …

0
94
Member Avatar for poloblue

Good Afternoon, I'm having trouble with a school assignment. The assignment entails: Write the implementation of the function subsequence for the orderedArrayListType class. Also write a program to test your function. Prototype: bool orderedArrayListType::subSequence (orderedArrayListType &S,orderedArrayListType &L); Definition: subsequence returns true if S is a subsequence of L, false otherwise. …

Member Avatar for poloblue
0
152
Member Avatar for highflyer8

Hi, if I run the following code and press L on the screen, I should be getting a leapfrog.txt textfile. But I only see my previous euler.txt. What is wrong with the code. Thanks in advance for any help. [CODE]#include <iostream> #include <fstream> #include <cmath> #include "H:\Visual Studio 2008\Projects\section2\threevector.h" using …

Member Avatar for thelamb
0
148
Member Avatar for Brie Guy

I made a string of States and under it a corresponding string of Capitals. I have it so it randomly pick a state and ask for capital or pick a capital and ask for state. Sometimes it repeats and I am trying to have it make a list of the …

Member Avatar for thelamb
0
76
Member Avatar for sarge66

I'm new to programing and any help would not only be appreciated but would probably help me pass this class. Exercise 1: Implement a Resistor Class Objective: Create a C++ console application that utilizes the core concepts of designing and creating classes, objects, properties and methods. Overview: Create and test …

Member Avatar for pseudorandom21
0
914

The End.