49,761 Topics

Member Avatar for
Member Avatar for chromos

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; …

Member Avatar for gerard4143
0
88
Member Avatar for GooeyG

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 …

0
85
Member Avatar for applepomme

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, …

0
82
Member Avatar for bmos31

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 …

Member Avatar for bmos31
0
165
Member Avatar for CodyOebel

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. …

Member Avatar for CodyOebel
0
139
Member Avatar for dkolcun

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 …

Member Avatar for dkolcun
0
111
Member Avatar for StacyAnn1296

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 …

Member Avatar for kes166
0
318
Member Avatar for iamboredguy

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?

Member Avatar for sujitkumarsingh
1
848
Member Avatar for Shredlegend

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 …

Member Avatar for kes166
0
101
Member Avatar for fire_

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 …

Member Avatar for Fbody
0
87
Member Avatar for vbx_wx

Can someone help me with a good template tutorial about c++ templates from begining to advanced ?

Member Avatar for Narue
0
27
Member Avatar for jakesee

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]; }; // …

Member Avatar for jakesee
0
157
Member Avatar for praky

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 …

Member Avatar for praky
0
4K
Member Avatar for fire_

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?

Member Avatar for fire_
0
164
Member Avatar for W34531

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] *************************** ************************ * * * * * * * * * * * * * * * *************************** * * * * * * …

Member Avatar for W34531
0
146
Member Avatar for gracy1011

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 …

Member Avatar for Ancient Dragon
0
46
Member Avatar for sDanyal

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 …

Member Avatar for Valaraukar
0
153
Member Avatar for Rishikeshan

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 …

0
74
Member Avatar for JDean89

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 …

Member Avatar for chiwawa10
0
113
Member Avatar for nhidman

someone help! how to split an audio file into chunks using c++? and merging it again...

Member Avatar for chiwawa10
0
170
Member Avatar for aravind rao

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 …

Member Avatar for aravind rao
0
175
Member Avatar for Lerner

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 …

Member Avatar for Lerner
0
153
Member Avatar for aviavyne

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 …

Member Avatar for NathanOliver
0
197
Member Avatar for doomfrawen

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 …

Member Avatar for doomfrawen
0
669
Member Avatar for Obsidian_496

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 …

Member Avatar for Narue
0
101
Member Avatar for Syrne

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 …

Member Avatar for Syrne
0
93
Member Avatar for hsquared

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 …

Member Avatar for mrnutty
0
100
Member Avatar for kuen

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; …

Member Avatar for kuen
0
112
Member Avatar for hsquared

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 …

Member Avatar for Fbody
0
138
Member Avatar for haggard433

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 …

Member Avatar for haggard433
0
118

The End.