Posts
 
Reputation
Joined
Last Seen
Ranked #348
Strength to Increase Rep
+8
Strength to Decrease Rep
-2
54% Quality Score
Upvotes Received
8
Posts with Upvotes
8
Upvoting Members
7
Downvotes Received
10
Posts with Downvotes
7
Downvoting Members
5
8 Commented Posts
0 Endorsements
Ranked #517
~38.9K People Reached
About Me

I'm no nerd. I'm a hunk :)

Interests
Lifestyle & Sports... and of course everything techie
Favorite Tags
Member Avatar for rennel

No one would ever want to implement a database using text file. The work involve are just very tedious. First of all, what are the 'data' that will be stored in your database? If it is all of a user defined structure, you can consider storing them as a binary …

Member Avatar for Sean_13
0
2K
Member Avatar for idesignyards
Member Avatar for piers
0
3K
Member Avatar for dalaharp

Here are some codes which you may use to record the time. [CODE] #include <time.h> time_t start, end; double duration = 0; time(&start); // your codes here time(&end); duration = difftime(end, start); // time in milliseconds [/CODE]

Member Avatar for rustysynate
0
3K
Member Avatar for bramprakash1989

If you wanna stick to your code, its fine. Just make some modification for an elegant solution. Here's my advice. I prefer to seed the random number generator first, then use the modulus (%) function to limit the generated number. [CODE] #include<iostream.h> #include<stdlib.h> #include<time.h> int main() { int i; cout<<"ten …

Member Avatar for dramatic
0
1K
Member Avatar for subith86

Is that all the codes that you have? Did you ever set any value to your variable 'commonVar1' before calling GetcommonVar1() method? If not, I suppose the result would be unexpected and the -1 is only a coincidence. If I'm not wrong, the child's property 'commonVar1' takes precedence over the …

Member Avatar for template<>
0
119
Member Avatar for akase2010

I don't see anything wrong with the OOP concept being used. And in fact, it is recommended practice so that they can be reused in future. Also, I do not see any error with the code. What's the number that caused the problem?

Member Avatar for caut_baia
0
222
Member Avatar for LevyDee

Your function to delete the last element from the linked list is good enough. However, do take note of the issue raised by arkoenig regarding the code [CODE] delete last; [/CODE] which apparently doesn't appear to be meaningful in the codes given. Do take note about the existence of other …

Member Avatar for LevyDee
0
107
Member Avatar for dip7

You are getting the codes wrong. Particularly at line 14 [CODE] int fgetc(FILE *stream); [/CODE] This line is not needed. Line 18 until line 34 (while loop) can be rewritten like below [CODE] c = fgetc(stream); while(c != EOF) { // logic goes here c = fgetc(stream); } [/CODE]

Member Avatar for Ancient Dragon
0
3K
Member Avatar for mbouster

[QUOTE=chikkupa;1431171]Edit your code as: [CODE]case 2: cout<<"Enter the Customers National Number ID"<<endl; cin>>ni; for (int i=0; i<150;i++) { if (ni==CustArray[i].customer_id) { CustArray[i].showCustomers(ni); } } break;[/CODE] [CODE]// Here loop is removed void Customers::showCustomers(int ni) { if (ni==customer_id) { cout <<"Customer Information"<<endl; cout <<"*********************"<<endl; cout<<"Customer ID:"<< customer_id <<endl; cout<<"ID:"<< id <<endl; cout<<"Name:"<< …

Member Avatar for mbouster
0
2K
Member Avatar for icasta13

I don't think you can read int from the file using ifstream. The problem with your code is that they are displaying the memory location of your array. Is there any reason to use an int array? You can use the read or readline function of the ifstream to capture …

Member Avatar for icasta13
0
214
Member Avatar for jeffpro

[QUOTE=jeffpro;1431218]no those are the hex values that should be placed in the byte accordingly. char Hi[4] = "3E2C"; needs to be converted into: Bye[0] = 0x3E; Bye[1] = 0x2C;[/QUOTE] Firstly, you got to read the Hi array 2 characters at a time. For the first character, bit shift it to …

Member Avatar for gerard4143
0
96
Member Avatar for mbouster

You can include an object of class Date into Flights just like any other data types. Your initialization of the Flight classes are correct.

Member Avatar for mbouster
0
285
Member Avatar for blueyelunatic

Your sum function is only taking the last value entered by the user as stated below: [CODE] sum=a[x]; [/CODE] The code comes after the for loop. At this point, the value of 'X' would have been 10 and its surprising that you are actually able to execute your program without …

Member Avatar for jonsca
0
87
Member Avatar for deanus

Debug mode lets you step in to the code and observe whats happening behind the scene as your code runs. You can put breakpoint to stop the execution of codes at the certain statement. In addition, you can also investigate the value of a variable when running in debug mode. …

Member Avatar for chiwawa10
0
138
Member Avatar for Meat!

If you're interested and serous about picking the language, get a good book. [The C++ Programming Language: Special Edition] By the creator of the language

Member Avatar for chiwawa10
0
86
Member Avatar for newCoder1545

Please describe your problem. What's the problem you're facing. Only then, people will know how to help

Member Avatar for chiwawa10
0
117
Member Avatar for chode1

It seems like your fifth line is of different format from the rest. Its really difficult to work with file of this kind as its data can take many forms. This is a general rule: For you to read data from file, you'll need to know the format beforehand. The …

Member Avatar for chiwawa10
0
95
Member Avatar for dnambembe

I don't see why your code doesn't run. Your GetNext() method should be called three times as stated by VernonDozier. Hence, the same piece of information is printed on screen three times. The only reason for the program no running properly (that I can think of) is the license.txt file …

Member Avatar for dnambembe
0
126
Member Avatar for newbee3

You could code it this way to request user to enter password [CODE] cout << "Enter password for user: " << username << endl; cin >> password; [/CODE]

Member Avatar for chiwawa10
0
107
Member Avatar for lochnessmonster

The .H (header) file is more of a code organisation means to make your code readable and easily maintained. Logically, declarations and definitions are placed in the header file to allow an easy glance over the codes. All implementation codes shall go to the CPP file (with same corresponding name)

Member Avatar for mike_2000_17
0
285
Member Avatar for samsons17

The function's name buildBackward doesn't describe what's been done in the function. Basically, the function builds a list with all the numbers entered by user. After the number -999 is encountered, it returns a pointer to the first node of the list. Having this pointer, the printList function iterates until …

Member Avatar for fmadsen
0
114
Member Avatar for keeda

1000 bits = 125 bytes Therefore, to read 1000 bits, all you have to do is reading 125 bytes. Using the example given by Ancient Dragon, your code should looks like: [CODE] unsigned char buffer[125]; ifstream in("filename", ios::binary); // provide extension to filename if exist in.read(buffer, sizeof(buffer)); [/CODE] Be very …

Member Avatar for chiwawa10
0
78
Member Avatar for qvyhnl

First off, what class do you want to inherit? Since there is no mention of a third class, it's hard to guess what class you want to introduce. Inheritance is easy. Let's say I am introducing a ChildSavings class which will inherit from the Saving class, the code would just …

Member Avatar for chiwawa10
0
218
Member Avatar for miha2

The ASCII table shows that A - Z has ASCII code of 65 - 90. On the other hand a - z has ASCII code of 97 - 122 You could manipulate the text as 'char' using ASCII code. For example, in the Caesar cipher, B (66) would be E …

Member Avatar for miha2
0
732
Member Avatar for mumar

Let's post some of your initial work and we shall assist you on any problem which you may have. Or at least, post some of your thought on how you're gonna solve the problem.

Member Avatar for Anuradha Mandal
-3
71
Member Avatar for VasquezPL

You may use if..else statement inside a case of a switch. For example, [CODE] int i = 2; bool a = true; switch(i) { case 1: cout << "Case is 1"; break; case 2: if(a) cout << "Case 2 and boolean a is true"; else cout << "Case 2 and …

Member Avatar for VasquezPL
0
155
Member Avatar for Lanor

Lanor, NULL is a non-display value meaning that it cannot be seen even when it's be written to the file. In the case where you want to display the word 'NULL', you should check for null value in the grade array and explicitly display 'NULL'. Here's an example [CODE] infle …

Member Avatar for WaltP
0
97
Member Avatar for Behumat

This is C++ and it is different from C#. You use the symbol '<<' to redirect your stream to the intended output. For example, to output the regular hours is simply: [CODE]cout << "Regular Hours Worked: " << regularHours << endl; // you would want an end of line here …

Member Avatar for Kremlan
0
156
Member Avatar for gus7984

Error LNK2019 relates to the failure of the compiler to locate an external symbol referenced in a function (linker error). Is your rstream header file in the same folder as your CPP file? Whats the full error message? Mind to post it here?

Member Avatar for chiwawa10
0
126
Member Avatar for Sohelp

For me, inline function is used in the situation where it will only be called from one place. The main purpose for me to implement it as an inline function is solely readability and design. That's when my function is getting too long and there are too many nested conditional …

Member Avatar for Sohelp
0
247