49,757 Topics

Member Avatar for
Member Avatar for nory22

Hi there i have wrote a program ,The user can only Choose the letter S for square or R for rectangle.. i have done every thing as you can see ... the only problem that am having is if the user puts 's' small letter also 'r' small letter .. …

Member Avatar for Arbus
0
184
Member Avatar for highflyer8

Any method (within a C++ class) that prints to a file or to a screen has a return type of void. What role does the keyword [I]void[/I] perform?

Member Avatar for Fbody
0
311
Member Avatar for nalasimbha

Hello, I am writing a program that integrates a function and returns the integrated value. The integration is to be performed from 0 to an upper limit which I specify. But the function I am integrating does not allow 0 to be used as the lower limit, as using 0 …

0
159
Member Avatar for HashIncludeDotH

Hello, I am required to implement a 1D then 2D DFT on an image. The problem is, I can implement both 1D & 2D DFT on a 2D array and it produces the "right result" except: 1. my answer often floats in 0 i.e. [code] for(int u = 0; u …

Member Avatar for HashIncludeDotH
0
1K
Member Avatar for Khoanyneosr

[CODE] #include <iostream> #include <ctime> #include <cstdlib> #include <string> #include <algorithm> using namespace std; //Types and Arrays string word[16] = {"GOLDFISH", "COMPUTER", "ANONYMOUS", "JACKET", "SHARP", "SERVICE", "EFFORT", "CHARACTER", "CHANGE", "WITHOUT", "PRODUCT", "UNFOLDING", "MUSIC", "MOMENT", "LIFETIME", "PROVIDE"}; // words that will be randomized. string hint[16] = {"Small colorful fish.", "A machine …

Member Avatar for daviddoria
0
187
Member Avatar for Helmyano

in the following code [CODE] class obj { protected: int somedata; public: obj (int x) {somedata=x;} }; [/CODE] i want to make another child class form this one and inherits the constructor plz help

Member Avatar for caut_baia
0
105
Member Avatar for saqi2926

Make following function of the string class with out using built in functions: Make a function that will combine data of two strings and save it in the third string.

Member Avatar for saqi2926
-4
82
Member Avatar for highflyer8

Compiling the following the class in the main program returns error C2784. What could be causing the problem? [CODE]#include <iostream> // Include input/output stream #include <cmath> class threevector { public: double xcoord, ycoord, zcoord; // Default constructor threevector() { xcoord = 0.0; ycoord = 0.0; zcoord = 0.0; } // …

Member Avatar for Fbody
0
532
Member Avatar for SourabhT

[CODE] #include "stdafx.h" #include<iostream> using namespace std; class Base { public: virtual void fun() { cout<<"base"<<endl; } }; class Der:public Base { public: void fun() { cout<<"Der"<<endl; } }; void func(Base b) { b.fun(); } int _tmain(int argc, _TCHAR* argv[]) { Base b; Der d; b.fun(); d.fun(); func(b); func(d); system("pause"); …

Member Avatar for SourabhT
0
157
Member Avatar for highflyer8

I have seen the following in a abook: "The argument(s) of a method can be any type of object (as long as its class has been made available to the program), as well as the predefined default types of variable. For example, methods in our three-vector class are not limited …

Member Avatar for dkalita
0
260
Member Avatar for Vindal

I need to be able to loop and get information for up to 10 "BankAccount" arrays, but when I use less than 10 it gives me garbage and I don't know how to fix it. Here is my Code. [CODE]#include <iostream> #include <iomanip> using namespace std; class BankAccount { private: …

Member Avatar for Vindal
0
168
Member Avatar for mpike

Ok so a friend of mine came up with this code to create a highscores list for a game when i run it, it works perfect you can see everything fine. the problem comes when it tries to reopen the file again. The file has abunch of gibberish inside and …

Member Avatar for WaltP
0
165
Member Avatar for triumphost

KK I've been using mouse_eventf for clicking buttons in another application.. To do this I've done GetClientRect to get the size of the client and then click the button at a certain distance from one edge of the client... What I noticed that is that if the user's computer is …

Member Avatar for Ancient Dragon
0
90
Member Avatar for maybnxtseasn

im wanting to make a class called Log. with the template as follows class Log { private: std::ofstream outputFile; SYSTEMTIME systemTimeBuffer; public: Log( std::wstring error1 ); Log( std::wstring error1, std::wstring error2 ); Log( std::wstring error1, std::wstring error2, std::wstring error3 ); Log( std::wstring error1, std::wstring error2, std::wstring error3,....... ); ......... ........ …

Member Avatar for mike_2000_17
0
113
Member Avatar for AODfan

The program is supposed to pull in data from an input file and sum numbers and not exceed 1000 and then stop, but it seems that my code is making it not calculate properly, it is less than it is supposed to be, but doesn't add to what is present. …

Member Avatar for AODfan
0
121
Member Avatar for ashrafu1

hello me and my friends were assigned to make a program that can add,delete,update and show information. we were able to make this code ( am sending u ) but we cannot solve some problem like the after adding or deleting or any other work the window does not goes …

Member Avatar for ashrafu1
0
466
Member Avatar for failbot

Hello, I am creating an implementation of LIST that displays a list of 4 elements and also displays them in reverse. It seems to be correctly displaying the first list but I am getting a segmentation fault error before it displays the reverse list and I am not sure why. …

Member Avatar for arkoenig
0
83
Member Avatar for sdr001

Hello. I am trying to figure out why my program has an infinite loop :/ The program asks a user how many digits they want their numbers to be and then the program needs to print out all binary numbers for the user inputted digits. For example: User inputs 3 …

Member Avatar for sdr001
0
106
Member Avatar for d0csss

#include <iostream> #include <cmath> using namespace std; class Rectangle { public: int width, height; Rectangle(); ~Rectangle(); double r_area(); double r_perimeter(); }; Rectangle::Rectangle() { width = 1; height = 1; } Rectangle::~Rectangle() { } double Rectangle::r_area() { return (width * height); } double Rectangle::r_perimeter() { return (2*width + 2* height); } …

Member Avatar for Chilton
0
88
Member Avatar for dahaker

Hi guys im making this homework on a program that the user will input the time in seconds and it will calculate the velocity and acceleration based on these formulas. Ive tried to compile the program but im getting 2 times "an illegal else without matching if" now the error …

Member Avatar for dahaker
0
3K
Member Avatar for lochnessmonster

if a constructor OR public member function throws an exception, will the objects destructor be called automatically?

Member Avatar for mike_2000_17
0
98
Member Avatar for pseudorandom21

Is there a way to store binary code in memory (as a value) then execute it? For instance if I have an array of bytes I have filled with the binary code of say, a .exe, is it possible to execute it?

Member Avatar for triumphost
0
90
Member Avatar for chaosgeneration

Hey all, I'm currently working on a project that exemplifies matrix multiplication algorithms. My problem isn't working on the algorithms, but more of the structure of the classes. If any of you wouldn't mind looking over my code and helping me get a little more familiar with how things should …

Member Avatar for chaosgeneration
0
127
Member Avatar for mitrious

I'm implementing a bi-directional iterator for a class (a simple list that holds strings) ... the book I'm using asked me to do so ... (I'll have to implement a version of the standard list class afterwards) ... but my iterators just won't work... here's what I have my iterator …

Member Avatar for mitrious
0
154
Member Avatar for sirko

Here's the deal. I need program to read from text txt file and then write numbers into one file and letters into the other... I figured how to read and write to file (using iterators) but I can't figure out how to make the program sort numbers from letters. #include …

Member Avatar for sirko
0
239
Member Avatar for thekitoper

Hello I need a way to make a file dialog box for selecting a filename/path. Is there a common file dialog box? I think there may be seeing as all of the GUI programs in Linux have a similar looking file selection type. Thank you.

0
67
Member Avatar for mpike

ok so i've just started using visual c++ for my coding. I'd like to add a sound files to my current project. I've looked up so many ways to do this from allegro to directx and BASS but i cant seem to get anything to work. I've been looking into …

Member Avatar for mpike
0
157
Member Avatar for jackmaverick1

In function `_start': undefined reference to `main' what does this mean? I don't have a function _start. and my main.cpp is empty, theres just a few giant source files (500+ lines together) that are never called... Do you see any problems with this that might have something to do with …

Member Avatar for jackmaverick1
0
113
Member Avatar for andimiami

I need to format my BMR output so it has a nice neat appearance with the Headings over each column. In one column it should say BMR and the other Daily Calorie Intake. This is what I have so far: [CODE]/* Program: Harris Benedict Equation * */ # include <fstream> …

Member Avatar for andimiami
0
214
Member Avatar for makman99

I need to create a program that monitors incoming packets to a certain process. Each incoming packet needs to be searched for a string of hex (eg. "FF 00 00 03") and modified to be null (eg. 00 00 00 00). Or, if it's easier, to just completely block the …

Member Avatar for makman99
0
108

The End.