49,766 Topics

Member Avatar for
Member Avatar for whotookmyname

I have to open a file whose name i am constructing by concatenating various inputs from the user. If I write: [code] string s = "filename.csv"; ofstream fout; fout.open(s,ios::app); [/code] it gives error for using s in fout.open(). It says it is a wrong form. I need to use a …

Member Avatar for sureronald
0
88
Member Avatar for TarekSliem

The problem that i couldn't know if the mistake from the code or from the compiler? i have been setup cygwin.........as starting to learn Linux and into it as a start to learn c++ i want to compile a (hello world) code ================== [code] #include<iostream.h> void main() { cout<<"helloworld"; } …

Member Avatar for ankitloud
0
251
Member Avatar for Zachster

I'm a newbie to C++ and am wanting to make a game where Zombies come after you and you slay them, along with jumping, running, shooting, stabbing, well you get the point but idk how. also i have a main menu done but i don't know how to preview it …

Member Avatar for shadwickman
-1
54
Member Avatar for Democles

Hello, I am trying to compile a set of files. I got fustrated to the point of taking the actually instructor files from the book and compiled them. I am using AndLinux and the g++ compile to run my programs. If anyone is familiar with the book "Accelerated C++" I …

Member Avatar for TimeFractal
0
156
Member Avatar for _dragonwolf_

Here is my final product: [code] #include <iostream> #include <fstream> #include <iomanip> #include <string> using namespace std; void printGrade(int oneScore, float average); void printTable(int scores[], int id[], int count); float computeAverage(int scores[], int count); const int MAX_SIZE = 21; void readStudentData(ifstream &rss, int scores[], int id[], int &count, bool &tooMany) …

Member Avatar for _dragonwolf_
0
136
Member Avatar for reyaanhelp

If anyone have "bus reservation system" c++ code in classes format then please give it to me.

Member Avatar for Salem
-1
67
Member Avatar for TheSilverFox

[code=CPP]#include <iostream> using std::cout; using std::cin; using std::endl; void Calculate( double ); int main() { int worked; double salary; double pay; cout << "Enter the hours worked: (-1 to end)" << endl; cin >> worked; cout << "Enter the salary: " << endl; cin >> salary; while( worked > 0 …

Member Avatar for csurfer
1
104
Member Avatar for doublebond

Hi Guys, Please help me in doing this. I am trying to read a file using fstream, but my prof wants me to do the same using hash table, which i have know idea. Please tell me hw can i do the same. The file contains huge data like the …

Member Avatar for csurfer
0
1K
Member Avatar for Cloneminds

Hello again, My assignment is to calculate a 10% bonus based on sales figures. I have to use a main() function, obviously, and 3 void functions, getSales(), calcBonus(), and displayBonus(). I'm pretty sure I have the functions coded correctly, I'm just having some issues getting them to actually run correctly …

Member Avatar for wildgoose
0
226
Member Avatar for slomad1956

I've searched for days on how to find the correct way to convert a string to a float and then double the user entry. Any help would be appreciated. Thanks. #include <iostream> #include <cstdlib> using namespace std; bool FloatInput(char []); void main() { float floatValue; char buffer[100]; bool validInput; do …

Member Avatar for slomad1956
0
127
Member Avatar for reyaanhelp

[code] #include <conio.h> #include <stdio.h> #include <iostream.h> #include <string.h> #include <graphics.h> #include <stdlib.h> #include <ctype.h> //#include <dos.h> typedef enum{false,true}boolean; static int p = 0; class a { char busn[5], driver[10], arrival[5], depart[5], from[10], to[10], seat[8][4][10]; public: void install(); void allotment(); void empty(); void show(); void avail(); void position(int i); } …

Member Avatar for csurfer
0
456
Member Avatar for Pokenerd

Hi, I'm working on a program to convert Celsius to Fahrenheit, but I have a problem when I run a check to make sure that input is not a letter. My problem is that if the user inputs a 0 it catches it with the [code=C++] if(num == 0) { …

Member Avatar for Pokenerd
0
104
Member Avatar for XodoX

Hello, I had to creat the following code that displays a table depending on the number te user entered. [code] int main() { int n = 0; const int base = 4; std::cout << "Enter max: "; std::cin >> n; std::cout << " "; for(int i = 1; i<= n; …

Member Avatar for NathanOliver
0
103
Member Avatar for Pokenerd

Hi, I'm looking for some help with this short program I am writing... I'm trying to make the sure that the user enters a number when it asks for the temperature in Celsius, and when the user enters a number it works. However if a letter is entered it all …

Member Avatar for Pokenerd
0
179
Member Avatar for somyasinha

Hi, How do I use the generator in the file? I keep randomc.h as a header file in the Visual c++ project. My project has several header files and several .cpp files, many of which require to use the random no. generator. I have copied all the files in the …

Member Avatar for u8sand
0
140
Member Avatar for goody11

I've tried like 100 different ways but I can't figure this out. I need each of these variables initialized and defined before they are used. Here is the bit of code: [code] int i, a; char etxt[100]; HWND hwndListBox = GetDlgItem(hEdit, IDC_LIST); i = SendMessage(hwndListBox, LB_GETCOUNT, 0, 0); //gets the …

Member Avatar for NathanOliver
0
129
Member Avatar for Pokenerd

Hello! I'm trying to make a command line program that converts Celsius to Fahrenheit, and then asks if you would like to convert another number. This is the code I have (below) however when it gets to the point of asking if you would like to convert another number, no …

Member Avatar for wildgoose
0
120
Member Avatar for gretty

Hi I am trying to teach myself C++ windows programing, ie creating windows applications (is that GUI or API or neither :P). I know the fundamentals of C++ programming but looking at some windows code it looks really difficult. [B]Can you suggest any good books or maybe some tutorial sites …

Member Avatar for Ancient Dragon
0
261
Member Avatar for zeus1216gw

I know how to make random numbers. and How to make random numbers in a specific range. BUT!!! How can you display 'x' random numbers in a given range and make it so the output display lists the numbers in groups a 'y'. For example: I want to display 25 …

Member Avatar for csurfer
0
115
Member Avatar for Leila1
Member Avatar for Salem
0
441
Member Avatar for gergep

i am wondering how to create a gui that is something like wxWidgets. I know how to use the windows api and all of that so i am not asking how to create a button or edit box but really am asking how to create a pixel on the screen …

Member Avatar for tux4life
0
78
Member Avatar for whotookmyname

I have to open a file named "axb.txt" I have user input a and b as strings i have concatenated the string using string str = a + "x" + b+ ".txt" now i need to open the file. it does not open with fopen(str, ios::app) because str is not …

Member Avatar for whotookmyname
0
305
Member Avatar for _dragonwolf_

Okay, so I have my program almost complete. I can get it to do everything except use the computeAverage. I know it works because if I hard code the arrays, I can utilize that and it will work. However, I am having to utilize what I pull from a .txt …

Member Avatar for VernonDozier
0
281
Member Avatar for cooolguy

hi.. i need to read a file.. in tat file i ve to read all strings and compare it with the given string.. hw 2 read strings in file exculding whitespaces n compare it..? help me...!!!!

Member Avatar for cooolguy
0
75
Member Avatar for penguhooks

[code=cplusplus] #include<iostream.h> #include<conio.h> float si(int p,int r,int t) { return(float)(p*r*t)/100; } int main() { int p,r,t,s; cout<<"enter the p,r,t"; cin>>p>>r>>t; float s=si(p,r,t); cout<<"simple interest="<<s; } getch(); } [/code] iam new to c++ and i was going through UDF's when i pondered upon this problem of calculatin the simle interest ... …

Member Avatar for Tom Gunn
0
308
Member Avatar for Rodman2009

How did you disable the Unicode, I used the same program and get the same errors, I tried to disable the Unicode by going to the properties of the program, and unticked the inheritance, but I still get the errors?

Member Avatar for Nick Evan
0
151
Member Avatar for cplusplusfool

Hii Friends, I do not know how to use FILE for writing data. I have tried something but i missed something to write and i do not know what to write now to get data inside file. Help me plz. Regards, Shivi circle.cc [code=cplusplus] #include <iostream> #include "circle.h" using namespace …

Member Avatar for csurfer
0
148
Member Avatar for didijc

Hey C++ guru's... I'm pretty new to the C++ world and would really appreciate some help... ... I'm trying to build a general tree (a tree with one root and N children), I've written the code and compiled it quote/un-quote successfully... ...I say that because I am faced with a …

Member Avatar for Laiq Ahmed
0
1K
Member Avatar for Shaitan00

I'm trying to declare a std::map that is keyed by a char and has a function pointer as a second parameter, these functions would be a member function of my class. But for some odd reason I cannot call the functions when extracted... So, I have a class A as …

Member Avatar for Laiq Ahmed
0
2K
Member Avatar for silent prince

i need ur help to write c++ porgram... this is the topic of it """"" Write a C++ program that calculates the perimeter and area of simple geometrical shapes based on the user’s selection. Let the program handle the perimeter and area calculations for circles, and Parallelograms. The program should …

Member Avatar for jencas
0
148

The End.