51,593 Topics

Member Avatar for
Member Avatar for lost_c++_dude

I've tried everything but this program won't run. If I plug in numbers for length, width, and depth it won't tell me the cost to resurface. Any suggestions? //prb01-1.cpp //This program calculates the total surface area of a pool and the cost to resurface it #include <iostream.h> #include<iomanip.h> //using namespace …

Member Avatar for alc6379
-1
132
Member Avatar for wangstarr

Hi, I am stuck and my head is spinning with this project that I am working on for my beginners c++ class. Can someone show me how to work this? Here is the problem: Write a function that uses an array parameter to accept a string as its argument. It …

Member Avatar for Narue
-1
2K
Member Avatar for Rasmo

Hi all, I'm a total beginner at C++, and I'm planning on trying out by writing a small, text-based game with a command line. The game has different areas which are described in pure text, and I guess a good solution to put all the pure data (descriptions and so …

Member Avatar for Xnoudas
0
118
Member Avatar for epsos

hi everyone i have been using ict for about 6 years now and want to learncomputing e.g programming and was wondering where to start becaause people post codes and i have no idea what they are on with and was wondering if there is any good sites where u can …

Member Avatar for epsos
0
186
Member Avatar for phr0stbyt3

im working on a program that generates a random number and asks the user to guess what it is. right now im stuck on checking to see if the number is between 1-20. how would i make it continuously loop back until the user enters a number between 1-20? the …

Member Avatar for phr0stbyt3
0
179
Member Avatar for darksea_99

I am looking into trying to buiild an onscreen display model based on field data to look at the factors that control the feeding and foraging of the northeern right whale - some have suggested that i use C++ and others Visual Basic. I need some help. The work would …

0
92
Member Avatar for jasweb2002

Hey everyone, I just started writing this program when I hit a problem with the destructor. Me and my buddies in the lab could not figure out what is going on. The error said something about symbol referencing error and refers to the destructor. The program is set in three …

Member Avatar for jasweb2002
-1
80
Member Avatar for toadie2004

this is my assignment 1) Write a C++ program to calculate the average test scores for 10 students. The test scores are stored in a file named 'scores.dat'. The average along with the test scores should be written to an output file named 'results.txt'. The input file 'scores.dat' contains three …

Member Avatar for Narue
-1
131
Member Avatar for smarkles

Hello, I'm doing a project for C++ using OPengl. I have the Super Bible and tried doing just the "simple program". I'm getting a l inking error. I used Win32 Console. Opengl is already installed, so I just downloaded Nate Robins glut llibrary and installed it as directed. What am …

0
105
Member Avatar for skamen

Hi, I'm working an a project that must take a text file (provided to us, in.txt) that has the scores of students from different sections on different labs. You can view the assignment page at: [url]http://www.cs.wmich.edu/~nelson/CS111FALL04/lab06/index.htm[/url]. The problem I'm having is that I can't think of how to make a …

Member Avatar for skamen
0
134
Member Avatar for bryan7890

program that asks user to input 12 numbers of any type or domain (i.e. positive or negative) and record user's responce into an array. Process the input by manipulating it so that the numbers are arranged in the array in an ascending order (e.g. -1.2, -1, 0, 3, 4, 4.05, …

Member Avatar for bryan7890
-1
113
Member Avatar for Tresa

hai can anyone please help me find the error in my program? when i try to compile it says case bypasses initialisation of local variable. i can't figure out the mistake. i am sitting with this for a week. i will be thankful if someone could help me figure it …

Member Avatar for alc6379
-1
87
Member Avatar for hill0ster

[QUOTE]I am having two problems with this code. #1) The user is to enter a three digit number for their employee ID. No problem there. But if the user enters a negative number, such as -1 the program is to end and display the total payroll for the month, total …

Member Avatar for alc6379
0
152
Member Avatar for kazmoney

All right, I have an assignment for this introductory C++ class, and I'm sorry if this sounds silly, but I really don't know where to begin. We've just now gotten through the different kinds of loops and nested loops and that sort of thing, and my assignment is to write …

Member Avatar for Narue
0
127
Member Avatar for Asif_NSU

I have to insert a node in a binary search tree. This is what i wrote for the InsertNode() method. But it keeps producing segmentation fault when i run the program. I couldnot find anything wrong in the code. The constructor for TreeNode(int x) sets the item to x, leftchild …

Member Avatar for Asif_NSU
0
81
Member Avatar for knucklehead

I'm having trouble with a program to calculate a triangles area using fstream. The problem is I need the program to open the function to calculate the area in a file ("project3_1.dat") and to read in another file with coordinates of triangles. I wrote what I could in my program …

Member Avatar for Narue
-1
145
Member Avatar for Tresa

hai can anyone please tell me whether it is possible to make graphics work in borland c++? thanks Tresa

Member Avatar for Narue
0
119
Member Avatar for N3wbi3C0d3r

I learn faster when i have a motive to learn. Well if i have a project that uses all of the tutorial i use, i will be motivated to read sections and use it and make a full on project. I use [url]http://www.cplusplus.com/doc/tutorial/[/url]. If anyone can conjure up a HUGE …

Member Avatar for N3wbi3C0d3r
0
139
Member Avatar for hill0ster

[QUOTE]I am having two problems with this code. #1) The user is to enter a three digit number for their employee ID. No problem there. But if the user enters a negative number, such as -1 the program is to end and display the total payroll for the month, total …

Member Avatar for Chainsaw
0
90
Member Avatar for JoBe

Hi, I just wanted to ask if someone could give me a name of a good book in wich the mathematical formulas are written down with some explanation about them :?: Reason I ask is, I'm going to evening school to learn C++ but in using C++ I encounter very …

Member Avatar for JoBe
0
399
Member Avatar for dcving

Everything works well, but I couldn't figure out how to use the else statement in case the user inputs 0 as a number..any comments/suggestions? [code] /* Program description: Create a program that prompts for two integer values. The program will display whether the integers are either: - and +, + …

Member Avatar for Narue
-1
115
Member Avatar for boujibabe

I am a student with an assignment to wirite a program that makes change but i am not getting the correct output what am i doing wrong? [code] #include <iostream> using namespace std; //function prototypes int change1(float); int change2(float,float); int change3(float,float); int change4(float,float); int main() { //declare variables float Purchase=0.0; …

Member Avatar for Chainsaw
-1
89
Member Avatar for roodope

[code] #include <iostream> #include <fstream> #include <string> using namespace std; const int MAXSIZE = 5000; double maximum(double nums[], int size); double combineMax(double max1, double max2, int size1, int size2); int main() { string inputFileName1, inputFileName2; ifstream ifp1, ifp2; ofstream ofp; double *num1 = 0, num2[MAXSIZE], *tmpPtr; int ctr1 = 0, …

Member Avatar for Narue
-1
118
Member Avatar for hopeolicious

I dont know what they mean by undetermined character constant [code] #include <iostream.h> #include <stdlib.h> class student { char st_name[25]; char st_major[25]; int i_test1; int i_test2; int i_test3; int i_average; char ch_grade; char ch_option; public: void getdata(); void processdata(); void putdata(); }; int main() { do{ student.getdata(); student.processdata(); student.putdata(); cout …

Member Avatar for vegaseat
0
283
Member Avatar for mdos

I was recently given a list of possible C++ interview questions by a recruiter for a firm on Wall St. One of the questions was: [b] How would you generate a compile time error if the sizeof(int) is not equal to 4? [/b] I was thinking along the lines of …

Member Avatar for Narue
0
371
Member Avatar for debashish

I am very new to c/c++ programming. i was writing a few lines of code and after compiling and running the program i did not receive the desired output. can you please help me in this matter. /* Test.c */ #include <stdio.h> main() { char i[30]; clrscr(); printf("Enter a name: …

Member Avatar for frrossk
-1
114
Member Avatar for anthmaina

i got this code segment frm a bk...but am not understanding it....help me out... :?: int place[4][3]={{1},{1,2},{1,2,3},{1,2,3}}; int row,col; for(row=0;row<4;row++) { cout<<'\n'; } for(col=0;col<3;++col) { cout<<setw(3)<<place[row][col]; } :rolleyes:

Member Avatar for Narue
-1
132
Member Avatar for onsbomma

Hello I know this is not good code, but i was wondering why dubble delete gives an error (not an exception!!) and dubble free doesn't?? If new/delete works like malloc/free. Is the error caused by the destructor?? and if so why??? [code] Integer *m = (Integer*)malloc(sizeof(*m)); free(m); free(m); Integer *m …

Member Avatar for Narue
0
132
Member Avatar for unicorn7

ok-ive been looking at this program for 2 hrs,trying to get it to compile with vi. no luck. im a beginning student with c programming. int sum -0, x-1 sum +=x; sum = sum + 5%2 printf("The sum is %d/\n",sum); ---------------------------------------------------------------- #include <stdio.h> /* int main(void) { int sum = …

Member Avatar for frrossk
-1
72
Member Avatar for sweety

Hi..this is a program to find if the no. is prime and to find the factorial of a given no. i have validated this program ..so that it gives an error message and [U]exits[/U] when negative nos. or zero are given as input. Instead of exit..i want to display the …

Member Avatar for sweety
0
89
Member Avatar for rajistephen

hai friendz, I am a Bioinformatics Masters degree student. I am doing my final semester project in the topic Molecular Docking on C++ in Linux platform. During the programming I felt a problem in calling/executing a progam in to my program. I have to call a program which accept a …

Member Avatar for rajistephen
0
112
Member Avatar for Flawless

How can i declare an array with variable size? i dont want it to be dynamic array, it have to be static. I mean the following: [code] int size; cin>>size; float array[size]; [/code] the previous code when compiled gives me that a constant expression required for the array declaration, although …

Member Avatar for Chainsaw
0
142
Member Avatar for roxanab

Hi. My name is Roxanne and I am a C++ / C# programmer. In the company that I’m working at, we are programming a business program for the customers and the software have been done in Visual C++ 6.0 I have to create and add to the software a new …

Member Avatar for Chainsaw
0
89
Member Avatar for hill0ster

I can't seem to get this code to displayEmployeeInfo if the user enters a negative number for ID. Also I can't seem to get a total of all wages to display. Any helpful hints would be greatly appreciated. Thank you! [code] #include <iostream> #include <iomanip> using namespace std; #include <string> …

Member Avatar for Chainsaw
0
137
Member Avatar for tushark

Hi all, when does the memory gets allocated to the function i.e. at compile time or at run time. If its at compile time the how is it? Thanks Tushar

Member Avatar for Chainsaw
0
126
Member Avatar for Alfy

[code] #include <stdio.h> int i,type; int buffer[100],line[50]; struct student { char name[20]; int age; int id; }; struct student students[3]; int main() { for(i=0;i<3;i++) { printf("please enter your name:\n"); fgets(students[i].name,sizeof(students[i].name),stdin); printf("please enter your age:\n"); fgets(buffer,sizeof(buffer),stdin); sscanf(buffer,"%d",&students[i].age); printf("please enter your id:\n"); fgets(buffer,sizeof(buffer),stdin); sscanf(buffer,"%d",&students[i].id); } while(1) { int *ptr=students; printf("Please enter the …

Member Avatar for Narue
0
147
Member Avatar for vegaseat

I found this neat little GUI calculator program on the net. It uses a function called _gcvt(double val,int limit,string cBuf), which seems to be used to convert a double val to a string cBuf, with some formatting and limiting. I replaced it with sprintf(), but the output looks rather crude …

Member Avatar for vegaseat
0
301
Member Avatar for WrEcK

ok im trying to make the towers of hanoi program but i get the following compile error: [Linker error] undefined referrence to 'WinMain@16' Heres the code, thanks for any help [code] #include <iostream> #include <cstdlib> using namespace std; void towers (int numDisks, char source, char dest, char auxiliary) { static …

Member Avatar for Narue
0
96
Member Avatar for hopeolicious

[code] #include <iostream.h> #include <string.h> #include <stdlib.h> #include <iomanip.h> class hope { char st_title[25]; char st_website[35]; char st_star[25]; char st_maker[25]; char st_rating[5]; int i_minutes; int i_year; float f_cost; int i_age; char st_status[6]; char st_response[20]; char ch_option; void getdata(); void processdata(); void putdata(); public: void run(); }dvd; void main() { char …

Member Avatar for Narue
0
168
Member Avatar for mister-fett

[B]I need some help finding a windows tutorial for C, not C++.[/B] (I am trying to learn C, compile about fifty pages of reference notes on it, and THEN learn C++. That way I dont have to worry about mixing things up, I will have notes and can forget about …

Member Avatar for mister-fett
0
139
Member Avatar for Behzad Oskooi

need help my program has a table and when progrm run , if for any reasen the power went off i missed last records that i post to table any body can tell me what can i do? :!:

Member Avatar for Behzad Oskooi
0
187
Member Avatar for brainFreeze

First of all, I am new to this forum. If I post this thread incorrectly, please let me know so that I will know better next time. :cheesy: I am having difficulty understanding what user-defined simple data types, namespaces, and string type have to do with calculating taxes. I am …

0
63
Member Avatar for Jason06

How would you write a program in c++ that would print all pythagorean triples from 1 to 50? :?:

Member Avatar for alc6379
0
63
Member Avatar for Nneedofhelp

I'm writing a program that reads a text file and puts it into an array of structs. There can only be one transaction per line in this format: custNumber firstName lastName numItemsPurchased amtSpent What I dont understand is how do you put the data in the file into an array …

Member Avatar for Nneedofhelp
0
127
Member Avatar for ze_viru$

hi guys, Below is my program and it is giving me turf time.I want it to read-in 1-for counting cars,2-for counting money and Esc-key for displaying totals.Pliz give me ideas.(i'm using Microsoft-visual c++) [code] #include <iostream> using namespace std; #include <conio.h> class tollBooth { private: unsigned int cars; double money; …

Member Avatar for Narue
0
139
Member Avatar for jigvesh

I was just thinking if it is possible to determine ones own ip address with the help of C++???Can someone please clear this query of mine

Member Avatar for alc6379
0
118
Member Avatar for tsverrir

Hi there. Im new to C++ programming, but I know my way around Delphi. I'm doing a project that must be made in Borland C++ Builder. My problem is right aligning items in TListBox and TComboBox. Any help would be appreciated. kv.TSverrir

Member Avatar for vegaseat
0
234
Member Avatar for lost_c++_dude

I've been working on this for hours I know the errors are staring me in the face but I just can't see them. Any help would be greatly appreciated. //prb01-1.cpp //This program calculates the total surface area of a pool #include <iostream.h> #include<iomanip.h> //using namespace std: int main() { const …

Member Avatar for frrossk
0
423
Member Avatar for coolmel55

Need a bit of help formatting my output. I'm not even sure that this can be done. The output from the following code looks like this: Here is your output! ******************** rval = 0.954316 tval = 9.03351 p = 0.999997 Two tailed value = 5.716140e-006 Ok is there anyway I …

0
148
Member Avatar for onsbomma

Where can i find more info about the inner implementation of new/delete?? There is a lot of info about the different kinds of malloc but i can't find anything about new/delete. IS this compiler specific or defined by the standard?? thx in advance

Member Avatar for onsbomma
0
383

The End.