49,761 Topics
| |
| I know that you can make a derived class object equal to a base class object, but I don't know how to do it the other way around. Here's the part of my code that I'm having difficulty with (Note: Animal is base class; Lion and Dog are derived classes). … |
| how can i insert the code for entering a password here?? the password should be in the main window...and it should be replaced by asterisk...HOW??? tnx [code] #include<stdio.h> #include<conio.h> #include<dos.h> struct phone { char name[20]; char ad[40]; char ph[20]; }; struct phone ar[100]; int n=0; void wfile(); void rfile(); void … |
hi! ^_^ i am very confuse on how to edit an external file? can someone tell me? | |
Following is a function I wrote to get a line of definite length from a long string. The line is also word-wrapping to make sure no words are splitted: [CODE=C++] char * getLine(char * str, int length, int start, int lenSent){ int index = 0, //Index number of the current … | |
so...i dont really understand my project -_- the teacher is asian as am i but he does not write english very well :3 can i get some hints maybe? ^_^ thank you i really appreciate it ive been stumped for such a long time :O "I typed the following 2 … | |
now...like...i need to concatenate the two words that the user enters, s1 and s2 and output them...i thought i needed to use strcat but like...i dont really understand how to do that here, do i need to make a new c string variable or...? ah i hate this stuff lol … | |
I'm trying to make a program to view 3d volumes. Basically you start with a bunch of data from an ultra sound or mri and then you load it into a 3d texture. Then you have a cursor made of three components between 0 and 1, and when you draw … | |
It's me again. :?: This is the question: Write a computer program that computes the temperature of a gas that is originally at P=5 atm, =V30 Liters, T=273 K. Solve the problem using one dimensional array only. Assume number of array elements is unknown (use the end of file function). … | |
[CODE] const char* findThisMsgInMem = "Hello World! Everyone is Happy"; if(memcmp(&dataInMem[i], findThisMsgInMem, defaultMsgSize) == 0) { memcpy(&dataInMem[i], newMsg, strlen(newMsg)); //more code here }[/CODE] This is first time for me trying to use malloc, and realloc. Please see the coding example for illustration purposes. Don't worry of this lengthy question, most … | |
I am enclosing my code and as you can see below the Event Recorded Banner the event type will not display. I would appreciate if you could show me what my problem may be. Everything else works properly. I am stuck. [code=cplusplus] #include <iomanip> #include <cmath> #include "EventBooker.h" EventBooker::EventBooker() { … | |
I have a problem with a program I'm writing. It's supposed to find the factorial of the number you input, but it's not. The problem seems to be that the recursive function isn't...well...recursing. Right now, when compiled, the program multiplies the number by the number before it. So if it's … | |
So I have the below code to check the input, I'm just having trouble because apparently flushing the input causes the tests (its an assignment) to lock up and I need to manually break out of it. The problem is that if I remove the flushing of the input it … | |
So, I'm attempting to write an object oriented program that solves simple sudoku puzzles by checking the rows, columns, and the 3 x 3 grid. [code] #include <iostream> using namespace std; #include "doth.h" int main() { User file: Sudoku call; int flag=0,ptx=0,pty=0; call.Display(); for(;flag != 1;) {[COLOR="Red"] if (Puzzle[ptx][pty]==0) { … | |
Hi, I have a homework problem in where I have to count the vowels from a readin file from a flashdrive/harddrive. Then the amounts of each vowel has to be displayed & which occurred the most amount of times & which occurred the least amount of times. Extra credit (which … | |
I have a little problem. I have a lot of code in the backgroundWorker2 (//Do Stuff) When pressing the button1_Click, everything works great and the code executes for the backgroundworker. But if I now try to drag the form around on the desktop, the form will "get stuck"(Not Responding). It … | |
I am new to C++ and attempting to complete an exercise my question is How you can use cin.ignore to ignore every character up to and including a specified character – for example a full stop, ’.’. | |
So A friend and I are new to C++ and we are trying to create a sudoku project and are trying to figure out different ways to do so. Right now we are stuck at the repetition checking. I was wondering if anyone could help us out?? We are trying … | |
I am at work and did this program on notepad and not sure if this is correct or not. Can someone that has the visual studio compiler test this and let me know if it works. If it does no could you offer any minor feedback on the location of … | |
I'm new to threading and wanted to make a program that was going to receive data from two separate pieces of hardware and populate a queu with their data. I then wanted to pull the data out of the queue and draw it to the screen graphically. So each piece … | |
I was given this assignment to create a function and have the user input a number and the function is suppose to give you the amount of change back. My program is listed below [code] #include<iostream> using namespace std; int change(int,int& ,int& ,int& ,int& ,int& ,int& ); int main() { … | |
I was reading about the new "tuple" type coming in c++0x, and I decided to try it. I saw that if you give a compiler flag -std=c++0x it will work. So I did it, and then #include <tuple> works and everything was good. Then I decided to try the default … | |
For this assignment you will write a wrapper routine for the LAPACK routine DGESV to solve the system of equations Ax=b (where A is a num by num matrix, and x and b are vectors of length num). A wrapper is a routine that reformats (or supplements) it's arguements in … | |
For this you will write a Gaussian Elimination routine (with or without pivoting - for most of you, I highly suggest without) that solves the equation A x = b where A is a square matrix (num by num), and x and b are vectors. A and b are known, … | |
Is there a built in type to store UNordered pairs? ie. I want these [code] pair<double, double> a(4.0, 5.0); pair<double, double> a(5.0, 4.0); [/code] to be equal. Do I have to make a wrapper and override == ? Thanks, Dave | |
| |
I often have this situation [code] class OrientedPoint { private: Point P; Vector N; Color C; bool valid; public: //////////// Constructors ////////// OrientedPoint() {} OrientedPoint(const Point &Coord); OrientedPoint(const Point &Coord, const Vector &Normal); OrientedPoint(const Point &Coord, const Color &C); OrientedPoint(const Point &Coord, const Vector &Normal, const Color &C); [/code] where … | |
Use the stack class in a program that reads a String, one character at a time, and determine whether the String contains balanced parentheses, that is , for each left parenthesis ( if there any ) there is exactly one matching right parenthesis later in the String . so the … | |
trying to write a program in C++ that will take a DC voltage as an input into a PIC16F88 (18 pin). and will output 2 seperate voltages, to run two different motors. when the input voltage is greater then 1.5v it will output a small voltage to both outputs, and … | |
Is pthreads still the way to go to detach a process from the main thread in linux? It seems seems kind of convoluted/old/c-style from looking at some examples - is there a more "c++" way? Thanks, Dave | |
Hi! can someone tell me how to count the number of lines? |
The End.