49,761 Topics
| |
amateur programmer here looking for some pretty basic help from the community. I am completing a program which is supposed to calculate the total monthly/annual cost for a vehicle; mind you, it's meant to be simple, but I probably shoot myself without noticing... [CODE] #include <iostream> using std::cout; using std::cin; … | |
A company has four sales people (1 to 4) who sell five different products(1 to 5). Once a day, each salesperson passes a slip for each different type of product sold. Each slip contains the following: a)the salesperson number b)product number c)total dollar value of that product sold that day … | |
I used this to write the matrix into a file: int Nx, Ny, Nz; Array <complex<float>, 3> matrix(Nx, Ny, Nz, ColumnMajorArray<3>()); ...get matrix data... fstream outbin(outname.c_str(),ios::out|ios::binary); outbin.write(reinterpret_cast<char *>(matrix.data()),sizeof(complex<float>)*Nx*Ny*Nz); outbin.close(); Then, I used this to read this matrix, works fine, values and orders are correct too: Array <complex<float>, 3> matrixb(Nx, Ny, … | |
I was just wondering how to pass two objects s1 and s2, both of which have to arguments, to a function, someFunction(). I actually only want to pass the second argument of each object for s1 and s2 to the same function, compare the two arguments and then display some … | |
I am programming in windows api, and I am familiar with using the ScreenToClient() function, and passing in a POINT structure variable for LPARAM with the coordinates defined in the point struct to simply send mouse clicks and so forth to the window in which I have the handle to. … | |
I'm very new to prgramming (in my first Programming class) and have a question about division. My project is to build a math flashcard program. I've gotten every thing else done but having trouble with the division. Where I'm having a problem is when the user inputs the correct answer … | |
Daily life magazine wants an analysis of the demographic characteristics its readers. The marketing department has collected reader survey records containing, the age, gender, maritial status, and annual income of the readers. Design an application that allows a user to enter reader data and, when data entry is complete produces … | |
I don't get why C++ pros see red when they see [B]void[/B] main(). Can someone explain why [B]int[/B]main() is good and [B]void[/B] main() bad? | |
My program is supposed to sort a doubly linked link alphabetically, and each node contains a single word string, my program crashes when it gets this far, whats missing?? void List::sortAlpha(){ Node * temp; temp=start; while(temp!=NULL){ string a=temp->word; string b=temp->next->word; string c; if(a[0]<b[0]){ c = a; a = b; b … | |
Hello. I know this is lame questinon but what is multi-if syntax? Like this: [CODE]if (a == 0) doSometihng(); if (a == 1) doSomething(); else doElse();[/CODE] Or like this: [CODE]if (a == 0) doSometihng(); else if (a == 1) doSomething(); else if (a == 2) doSomething(); else doElse();[/CODE] I'm useing … | |
Can someone help me with a good template tutorial about c++ templates from begining to advanced ? | |
Hi folks, I have a mathematic Vector3 class that looks like [CODE] class Vector3 { public: union { struct { float x; float y; float z; // btw, if declared like // float x, y, z; // will there be a difference in packing order? }; float v[3]; }; // … | |
i am writing a program on huffman's code in C++. I have wriiten the program till building the huffman tree. now I have to generate the code by traversing the huffman tree. I have no idea how to do that logically. please help with code or algorithm. Here is my … | |
Hello. I need your help. I need to write program wich will take numbers from other program's edit. I'm pretty sure that other program is writen with C++. Can you help me to write reading from edit part? | |
You need to submit printouts for question 4c only. We want to display one of the following blocks on the screen, using the same program: [code] *************************** ************************ * * * * * * * * * * * * * * * *************************** * * * * * * … | |
Hi, I am working on a project in VC++, i want to get find all the MS project files(.mpp) opened . I am able to get Windowandle for the active window of MSP but not being able to find Handle for other windows (which are in background). Is there a … | |
I have installed windows 7 which has a built-in intel graphics media accelerator. But there is no option available to check and change its properties. So the problem is that i am building a 3D game in OpenGL but when i run it a message appears that this program has … | |
I am a c++ programmer. I am interested in ogre. What are libraries needed to compile first of the beginner's tutorial? I already linked 6 .a files. I could not understand the error. Anyone please help. Thanks in advance. Error: [code=c++] ----- OGRE ( MAIN GCC DEBUG DEBUG_FULL BLITZ WIN32 … | |
Hi, I'm not sure what this code does. [CODE]int total(int value1, int value2) { int sum; sum = value1 + value2; return sum; }[/CODE] This method should take in 2 values and calculate the sum and return it. But I don't understand where it returns it to? In my main … | |
someone help! how to split an audio file into chunks using c++? and merging it again... | |
Hi I am developing a program that uses Breadth First Search to map a grid(2d array) out. Breadth First Search involves storing nodes in a stack and then exploring these nodes based on Breadth or level. I know how to create a vector array which I shall use as a … | |
Suppose you have a node declared like this:[code] struct node { int data; node * next; };[/code] and a list class declared like this:[code] struct myList { node * head; node * tail; int numNodesInList; //member functions etc, but no other member variables. };[/code] Then what is the size of … | |
Hello It's me again, some might have seen a similar string, and it is probably because it is the same, but with a different problem. The following shows a program which uses a function that converts Fahrenheit into Celsius. The problem is that a person can enter any value they … | |
Hello friends, I am writing a program that behaves like a (Linux)shell (but it's not really a shell because it does not interpret commands itself). It will read some commands like in Linux shell and then run the command in the same window of course. The standard MSDOS shell does … | |
Hello. I've been trying to understand an online material about Binary search trees posted there [URL="http://www.vias.org/cppcourse/chap21_10.html"]http://www.vias.org/cppcourse/chap21_10.html[/URL] I wonder if the code given for class is wrong, or does it use ideas I'm not familiar with? I'm not able to get it to work in my Borland compiler either. It seems … | |
So for my first assignment of the semester I need to write a program that: 1.) Asks the user to input a string 2.) Asks them to replace part of the string 3.) Have the program prompt "Yes" or "No" on whether the user wants the program to restart, if … | |
when adding data into a binary tree, is it possible to add more than one field of data per node? for example say the first left child will have something like "info", would you be able to add a name and age field, then be able to display it? it … | |
hi guys, i have some questions here Q1- i want to write programme to count the even and oss numbers example: the user input is 12345 so: even= 2 , odd = 3 this is my code [CODE]int even[5]={0,2,4,6,8}; int odd[5]={1,3,5,7,9}; int n[10]; int count_even = 0 ,count_odd = 0; … | |
how would i go on about adding an item into an array. the catch here, is that instead of adding content normally, i want the added content to be added as a linked list. for example, if i add something into the first slot, and want to add another item … | |
I'm trying to send a list of songnames to a client i built. Everything compiles fine, it even sends the first filename right. When the server begins to send the second filename it sends every filename as one. E.g: First: Like the way.mp3 Second: Pump it up.mp3Billionaire.mp3...... it just continues … |
The End.