49,756 Topics

Member Avatar for
Member Avatar for DREAMER546

hey .. please i need help with this code when i write it and i start in case 3 .. i've error massage .. illegal case .. why is that ? [CODE][LIST=1] [*]#include <iostream> [*]#include <string> [*]using namespace std ; [*]class employee [*]{ [*]private: [*] string name; [*] int salary; …

Member Avatar for DREAMER546
0
80
Member Avatar for johnnyjohn20

Hi, I have an array with elements filled with values such as 36.0119. I am trying to find a way of rounding each value to the nearest whole number E.G. 36. To show i have attempted this i have used cout with the array and set precision which is ok …

Member Avatar for WaltP
0
961
Member Avatar for tootypegs

Hi, i would like to be able to create an icon that appears in the tray by the clock in the bottom left of the desktop. I've looked around and found a little help on msdn but im struggling to understand everything on it, i have the following code (from …

Member Avatar for Ancient Dragon
0
95
Member Avatar for johny112

Im getting 2 of these warning message upon compiling the programme below. Cant figure out why. can someone help please? warning C4700: local variable 'rate_of_pay' used without having been initialized warning C4700: local variable 'hours' used without having been initialized Question Develop a C++ program that uses a while structure …

Member Avatar for Ancient Dragon
0
84
Member Avatar for tones1986

Hey folks. I am working on a program (really its 2, but they go hand in hand). The first one takes a text file which contains the following: last name first name SSN Salary Years employed There are 7 entries in the text file to be read in... The program …

Member Avatar for vmanes
0
155
Member Avatar for guitarrick

How many bools can I connect?? e.g. if((x>j) || (y<t) || (m=c) && (x != 0)) Please pardon any improper syntax, and any guidance is greatly appreciated (My text doesn't go into great detail with bools, but we're working with classes right now, and in one example there are three …

Member Avatar for guitarrick
0
355
Member Avatar for ricnyx

#include <iostream> #include <fstream> using namespace std; int main( ) { ifstream fin; ofstream fout; fin.open("income.dat"); if (fin.fail( )) { cout << "Input file opening failed.\n"; exit(1); } fout.open("total.dat"); if (fout.fail( )) { cout << "Output file opening failed.\n"; exit(1); } double next, sum = 0; int count = 0; …

Member Avatar for ricnyx
0
130
Member Avatar for Chaster

Hi everyone, I created a quite complex model in 3d studio max, then I converted it to an .obj file. In 3dsm I put the textures, everything looks fine. Then, when I load the object file it's gray again. I tried the following: - read the texture file (BMP) - …

0
59
Member Avatar for johny112

Im trying to write the programme for the following question, and im really struggliing. I will be reaaly thankful if someone can give me some tips or a programme for this. I would also like to point that im new to programming and this website so please give me some …

Member Avatar for johny112
0
100
Member Avatar for misdongard

hey ppl.. can someone please help? I am aware that u said u have to attempt the question urself but my teacher is an asshole and doesnt know how to teach very well. and he dropped a big question on us and none of us know how to do it, …

Member Avatar for Lerner
0
77
Member Avatar for java.cream

Hi all, [CODE]1: #include <iostream.h> 2: 3: int main() 4: { 5: cout << "Hello World!" << endl; 6: return 0; 7: }[/CODE] In the above code does the line 6 (return 0), required by the operating system,that means tells the operating system a program finish? If true, what the …

Member Avatar for Ancient Dragon
0
104
Member Avatar for nicz888

[code=c++] #include <cstdlib> #include <ctime> #include <iostream> using namespace std; // prototype and name space declaration bool testAnswer(int, int, int); void correctOutput(); void incorrectOutput(); bool mathTest(); //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ int main() { if (mathTest()) { !(mathTest()); mathTest(); } } bool mathTest() //main function { srand((unsigned)time(0)); // random number generator int …

Member Avatar for Ancient Dragon
0
126
Member Avatar for tonyaim83

Hi I m using the boost graphml.cpp file to extract information from a graphml file. But when trying to compile this i m getting compilation error `C:\boost_1_34_1\libs\graph\src\graphml.cpp expected } at end of input` What can be the reason for this. I checked it out the all combination of braces are …

Member Avatar for tonyaim83
-1
164
Member Avatar for rajsharma_85

hi guys, I am making a program in which I have to enter start date and time and stop date and time in format like 01:05:07 15:26:57 I know that i need to use <time.h> function for that but i don't know how can i calculate the difference between time. …

Member Avatar for Salem
0
141
Member Avatar for edek

Hi all! I need to create regex that matches everything before some specified (whole) word. Lets say I need everything before 'have' in such text: What ^7^*#/> I @@3->;: have to do with this *~~@}}], hmm...? ...so I would like to have "What ^7^*#/> I @@3->;: " as a result …

Member Avatar for edek
0
87
Member Avatar for ubc123

Excellent resource for C/C++/C#, java, JavaScript DHTML, C / ANSI-C、 SQL / MySQL it contains thousands of examples, downloadable source codes and tutorial... Please have a look。

0
53
Member Avatar for rodce

I'm a beginning C++ student/programmer, and I'm having a difficult time coming up with an algorithm to solve a programming problem. If someone could give me a recipe on how to go about solving the following problem using c++, I would appreciate it. Problem: A school has 100 lockers and …

Member Avatar for WaltP
0
659
Member Avatar for matt611

I need to read a file one word at a time. When I read the word it needs to be stored in a char* so I can pass it into my hash function. Whenever I try getline or infile>> my program just crashes. could someone please tell me what I …

Member Avatar for ravenous
0
116
Member Avatar for DREAMER546

hey .. please i need tutorial 4 vector .. because i'm tring to convert this code from array to vector .. but i failed .. so i think my way is wrong .. :( [CODE=c++]#include<iostream> using namespace std; #include<string> #include<vector> class student_recored{ vector<int> ex; string name; long ID; public: void …

Member Avatar for DREAMER546
0
98
Member Avatar for drvd80

Hello Peers, I have a sequence of data files (Site_1.txt, Site_2.txt,.....,Site_N.txt) that i need to read into my main program. Although I managed to construct the file names (as character arrays using sprintf), I am not sure of how to pass them to the ifstream, as it needs the file …

Member Avatar for Duoas
0
2K
Member Avatar for Duki

Ok, I'm going post all of my code, and hopefully someone can tell me where my error is at. I'm guessing I need to do a cin.ignore() somewhere, but I'm not sure where. I've tried it in a couple of places, but nothing has fixed the problem completely. [code=c++]#include <string> …

Member Avatar for jbennet
0
229
Member Avatar for picklesandmayo

I am writing a program that generates 2 random #'s then asks the user to give the product of the 2. I have everything (close to) working except the input. I even added a "cheat" to display the answer [inlineCODE]prod[/inlineCODE] and when inputting the exact same #, it is registering …

Member Avatar for vmanes
0
95
Member Avatar for anshul.dilli

hi plz help me overcome a few errors in my encryption project.... thanks [CODE]#include <iostream.h> #include <stdlib.h> #include <fstream.h> #include <stdio.h> #include <string.h> #include <dos.h> #include <conio.h> char passwrd[6]="",pw[7]; char pass[7],code; void genpassword(); void getpassword(); void doCrypt(char *cool) { int cryp; //the main int this function uses char x; //to …

Member Avatar for anshul.dilli
0
108
Member Avatar for picklesandmayo

I have a switch statement with 2 functions. I put 2 test [inlinecode]cout [/inlinecode] statements, both of which get displayed, but only one function is actually performed. A third test [inlinecode]cout [/inlinecode] statement is made in the second function, but that does not get displayed. "switch" and "switch2" get displayed. …

Member Avatar for picklesandmayo
0
100
Member Avatar for johnnyjohn20

Hi, I am trying to set up a program to allow the user to enter an odd number between 3 and 31. The program will then divide 360 between 1 and the user input-1. For example say the user enters 7, the program should divide 360 to each value 1, …

Member Avatar for vijayan121
0
104
Member Avatar for mikeandike22

The program calculates the standard deviation by having the user input the list of numbers into an array. So i get these errors on the program error C2057: expected constant expression error C2466: cannot allocate an array of constant size 0 error C2133: 'Nums' : unknown size here is the …

Member Avatar for Nick Evan
0
275
Member Avatar for blackslash13

Which is the most suitable source code? I need a programmer with a large experience on C++ to answer this question. [code] #include <string> #include <iostream> #include <limits> int main() { using namespace std; const int THISYEAR = 2007; string yourName; int birthYear,bad_input; cout << "What's your name ? " …

Member Avatar for Salem
0
99
Member Avatar for c.kiranmayee
Member Avatar for Amnah AL-Abdi

hello..... iam new memeber,and may be my quistion is easy to ask it,but really i need to help me in my problem. we know that the size of any array must be determined befor the running time,since it static location, my quistion is: if i need to make aprogramme in …

Member Avatar for ithelp
0
80
Member Avatar for mauriciomf

I tried strcpy() to copy AnsiStrings, but is only for (char *) type. Anybody knows how to do this, i'm using Borland C++ 6.0.

Member Avatar for mauriciomf
0
85

The End.