49,761 Topics
| |
Hey guys, Im a beginner in programming...so please bare with me. my project is to create a simple calculator program with a twist. the user needs to input 3 variables which is 1st number, 2nd number and the operator(+ - * /). but when the user wants a square root … | |
I didn't want to fill up a thread with a bunch of code, but I couldn't find a way to attach a file to an e-mail using this site's "send a message" system. I would have inserted the .CPP file. This is a basic windows program to run tests on … | |
I am using CListBox(MFC Class) which have some strings added to it.I want to display different string in different font.Is this possible?How this could be done? regards, | |
I'm new to C++ graphics, and a friend tipped me off to OpenGL. I'm currently trying to work with the GL Utility Toolkit ([INLINECODE]#include gl\glut.h[/INLINECODE]), which I had to download from the web. Due to all the download sites being intended for people with older versions of Windows (I think), … | |
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 < … | |
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 | |
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, … | |
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 … | |
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 << … | |
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 … | |
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 … | |
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 | |
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 … | |
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, … | |
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 … | |
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 … | |
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 = … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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..... | |
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 … |
The End.