49,757 Topics
| |
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 .. … | |
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? | |
| 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 … |
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 … | |
[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 … | |
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 | |
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. | |
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; } // … | |
[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"); … | |
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 … | |
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: … | |
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 … | |
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 … | |
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,....... ); ......... ........ … | |
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. … | |
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 … | |
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. … | |
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 … | |
#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); } … | |
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 … | |
if a constructor OR public member function throws an exception, will the objects destructor be called automatically? | |
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? | |
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 … | |
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 … | |
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 … | |
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. | |
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 … | |
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 … | |
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> … | |
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 … |
The End.