49,755 Topics
| |
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? | |
csci>g++ -c queue.cpp csci>g++ queue.o project6.cpp Undefined first referenced symbol in file Queue<int>::return_index() /var/tmp//ccHbZwrM.o Queue<int>::enqueue(int) /var/tmp//ccHbZwrM.o Queue<int>::dequeue() /var/tmp//ccHbZwrM.o ld: fatal: Symbol referencing errors. No output written to a.out collect2: ld returned 1 exit status These are my errors. As you can see, my implementation file compiles, but does not compile … | |
Hello..... i got a problem where my output are repeated..... how to solve this problem.... [code=cplusplus] #include <stdio.h> #include <stdlib.h> #include <iostream> #define MAX 100 int num[MAX]; int n; int nrows = 0; int temp =2; using namespace std; void print() { if (num != 0) { for (int i … | |
I have recently learned about virtual functions and it is to my understanding that they are a keyword that goes in front of the return type when defining a function. They go in a base class, and make it so that if a member function of the base class is … | |
Hi, i was wondering if it is possible to launch a .exe file using c++? say i want to write a simple program which will ask the user if the would like to install the following.:(i am just making it up) Please pick the number beside the program to launch … | |
I am testing a program that I am trying to run and having some difficulties with it. If you run this program I am able to compille it fine but will not return anything and stalls on me...Here are the instructions..... There are 25 digits split into five groups of … | |
ok so i have some code that works perfectly with visual studio 2003, but when i move it into my project which is using visual studio 2008, the compiler spits out 9 errors. compiler output: [CODE]1>Compiling... 1>main.cpp 1>.\main.cpp(3) : error C2011: '_STORAGE_QUERY_TYPE' : 'enum' type redefinition 1> C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winioctl.h(641) … | |
Hi basically I've exhausted my mind looking for resources and help on the Huffman Tree Coding. This is my problem, there are 2 parts to what I have to do, the first done: 1. Given a text file, determine the frequency of each character in the text (map of character … |
The End.