49,757 Topics

Member Avatar for
Member Avatar for tracethepath

the last record is getting displayed twice.i hv rechecked everything and cudnt find the error. here is the add n display function. [code=c++] void add() { example abc; int n; ofstream file1("EXAMPLE.dat", ios::binary|ios::app); cout<<"Enter Number Of Records To Add "; cin>>n; cout<<endl; for ( int i = 0; i < …

Member Avatar for Narue
0
2K
Member Avatar for pri_skit

I want to read MS-Excel file using EVC++ 4.0.The file contain strings.How this could be done?Thanks in Advance. Regards, priyank

Member Avatar for Ancient Dragon
0
88
Member Avatar for gator6688

I am trying to figure out when I enter the data instead of asking for person #1: everytime I can get it to ask person #1: then on the next line person #2: and so on. Here is my code so far: [CODE]#include "stdafx.h" using namespace std; int _tmain(int argc, …

Member Avatar for WaltP
0
92
Member Avatar for coolbreeze

Hey guys, I'm new to this board and C++ and was looking for a little help or guidance on this program my professor assigned. She assigned the class to create a BMI Calculator, and I have all the nessesary input given for it to work perfect but im not sure …

Member Avatar for WaltP
0
122
Member Avatar for gator6688

I have to be able to have the program output invalid input if the number is not 1,2,3,4. When I run this program it automatically puts invalid for everything. [CODE]#include "stdafx.h" using namespace std; int _tmain(int argc, _TCHAR* argv[]) { const int People = 5; int i, PeopleTypes[People]; cout << …

Member Avatar for WaltP
0
100
Member Avatar for toncoolx

Hello there, I need to write a function that insert new data into a text file, and I manage to do that, but only for the first row.... When I close my program, and reopen it to key in a 2nd input, it will simplely overwrite my 1st input. how …

Member Avatar for toncoolx
0
220
Member Avatar for erizy

There are situations that exception could be throw within constructor and we usually employ auto_ptr to protect resources. But if we do not have auto_ptr can we use the following technique to handle it? Please search "QUESTION" and see my question. Thank you for helping!!! [code=cpp] #include <cstdio> using namespace …

Member Avatar for Duoas
0
122
Member Avatar for greglobal

I want ot develop a game using windows mobile 5.0 for a smartphone. I am able to play a wav file using Playsound() but unable to play mp3 or sfx files. Can anyone suggest a site or provide a code snippet in C++ for the same ? Thanks abbu

0
56
Member Avatar for DemonSpeeding

I have a file that is representing an image, here's the puddle.img file: 10 22 2222888222882222228882 2222888222882222228882 3333333333333333333333 1111111111111111111111 1111144444111111111111 1111444444411551111111 1114643434345551111111 1111333333311551111111 1111133333111111115114 1111111111111111115543 The first two numbers are the size of the image, rows and then columns. Then I have to pull in the image, and before the …

Member Avatar for DemonSpeeding
0
200
Member Avatar for cms271828

Hello there, I come from a Java background, and I am a very able with java. I would like to try C++ to build a chess engine, since my java chess engine lacks the performance that can be obtained using C++. I've been trying to set up a C++ IDE, …

Member Avatar for Duoas
0
138
Member Avatar for Acidburn

Hello there ive written my own linklist in a template way but it doesnt seem to want to work when i add classes rather than primitive data types to the list... heres the code: [the node itself (template) [code] #ifndef LINKLISTNODETEMPLATE_H #define LINKLISTNODETEMPLATE_H template <class T> class LinkListNodeTemplate { public …

Member Avatar for Duoas
0
119
Member Avatar for corruptsystem

Our group has been banging our head against the wall in this one and cannot seem to figure it out. Our program is to be able to set up menus (done), allow user(s) to input 'student names' and save them to a data (*.dat) file and add names to the …

Member Avatar for corruptsystem
1
188
Member Avatar for teppuus

Hello, I would like to be able to declare a filename as a global constant (so I can change the input file easily), which seems to be a simple thing to do, but I can't seem to get it to work. I declared this globally: [code] const string RES_FILENAME = …

Member Avatar for teppuus
0
115
Member Avatar for step2stepgirl

i need help to make this program work i created a class and made the setter and getter and it compiles now i made search by name and id but it doesn't work and i need to find max average for 10 students and print information of the student with …

Member Avatar for Ancient Dragon
0
131
Member Avatar for cl3m0ns

Okay, so I just got some help on how to find the average of 30 randomly generated numbers. The next thing I would like to do however is a little trickier, I think. I would like to display the highest randomly generated number in the equation. Here is what i …

Member Avatar for cl3m0ns
0
92
Member Avatar for wonderland

Hi, I Have tried to make average calculator but I cant make few things happen and I would really appreciate some help with this. This is the code I came up with. Questions are below. [CODE]#include <iostream> using namespace std; int main () { int a, b; float result; cout …

Member Avatar for wonderland
0
178
Member Avatar for cl3m0ns

I am trying to write a program that takes a specif range from the user and generates 30 random numbers in that range. I have that part worked out and the code works fine but I have no clue how to take the average of those 30 random numbers. Could …

Member Avatar for cl3m0ns
0
91
Member Avatar for HLA91

Hi all I am totally new to C++ and I am using the Dev C++ compiler and getting the tutorial off [URL]http://www.cplusplus.com/doc/tutorial/program_structure.html[/URL] I ran the first program (code below) and it compiled fine but when I run it a box appears then dissappears so quickly I dont have time to …

Member Avatar for Narue
0
173
Member Avatar for nano404

Hey. I'm having some problems with creating user defined functions. [code] # include <iostream> using namespace std; int num1, num2, x, y; int perimeter (x,y); int main () { cout << "Enter the length and width of the rectangle: "; cin >> num1, num2; perimeter (num1,num2); cout << "The perimeter …

Member Avatar for nano404
0
124
Member Avatar for sugarflaps

hi im new to c++ and i trying to create a triangle series which looks a bit like this * ** *** **** ***** * ** * * ** *** **** ***** here is my code so far and my error message [code] //Lyndsey Scott //Tutorial 4 //Simple c++ program …

Member Avatar for Narue
0
69
Member Avatar for Duki

I have a question on my handout for class that says: Justify / refute the statement that theese declarations are equivalent. double speed[1] ; double speed; My guess was they are the same, since, even though speed[1] is an array, it is the same size of just speed. Am I …

Member Avatar for Narue
0
112
Member Avatar for Fromethius

Without creating global variables, is there a way to pass variables to the WindowProcedure that handles the messages? For example, if I create a variable and initialize it in WinMain, is there any way to use it in my WindowProcedure? What I am doing is this. I have a class …

Member Avatar for robgxxx
0
96
Member Avatar for Dashing Boy

Hi all, I have a homework my homework is to place the remaining 7 queens pieces from the game of chess on a chessboard so that no queen piece is threatening another queen on the board after user had placed the 1st queen on the position of his choice using …

Member Avatar for ithelp
0
78
Member Avatar for psyman_86

Hi everyone, I'm trying to implement a binary search tree but im having troubles with my Add function. The add function is supposed to take a pointer to a variable and add it to the tree. To begin with, the add function is called from Insert, which sends the new …

Member Avatar for psyman_86
0
84
Member Avatar for anirudhbsg

hi there my c++ programs are not running an error message is coming that tv.lib not found but i have checked that this lib file is there along with other file in the path that i have specified in directories path option ... can anyone help me.....

Member Avatar for Salem
0
82
Member Avatar for complete

Apart from buying BoundsChecker or any of the other tools to track down memory leaks. Does anyone have any advice or tips from your years of programming experience to offer on how to track down the causes of memory leaks? I find that the big dump that happens at the …

Member Avatar for ithelp
0
94
Member Avatar for Asif_NSU

i have this assignment to compute the factorial of an integer of any length. I have done it using array of char and then overloading the * operator accordingly. It works fine but i wanted to know if there were other efficient algorithms for counting factorials of any length. Give …

Member Avatar for roxanne_gem07
0
274
Member Avatar for jrice528

I am so close to finsihing my homework im on last programmign assignment. I have the program written but i cant figure out what to take from main and put into my flip function. the teacher said it should only contain one lineof code. Anbody have any ideas?Which is : …

Member Avatar for ndeniche
0
104
Member Avatar for Duki

Hey guys, Could you tell me what is wrong with this part of my code: [code]#include <iostream> using namespace std ; class TwoD { public: TwoD ( ) ; TwoD ( int , int ) ; private: int *m ; int d1 ; int d2 ; }; int main ( …

Member Avatar for ndeniche
0
83
Member Avatar for toncoolx

Hello there, I recently need to use c++ to do a project, and I occur some problems, hoping can get some advices from here, many thanks! My project allow a user to input a number and i need to retrieve the data from a text file. My text file's data …

Member Avatar for toncoolx
0
101

The End.