Posts
 
Reputation
Joined
Last Seen
Ranked #350
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
~39.7K People Reached
About Me

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

Interests
Lifestyle & Sports... and of course everything techie
Favorite Tags

138 Posted Topics

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
122
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
226
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
110
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
219
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
97
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
289
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
90
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
141
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
87
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
120
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
98
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
128
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
110
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
311
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
117
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
80
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
220
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
745
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
73
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
156
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
100
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
159
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
132
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
250
Member Avatar for moonL!ght

This has got to do with your header location in the physical directory. Check that it is in the same directory as your CPP file. Otherwise, you may specify the relative path of the file in your include statement.

Member Avatar for chiwawa10
0
132
Member Avatar for diagramatic

Emphasis should also be given to naming convention used for variable, method and class names. They should be short, precise and descriptive. It is one of the area that is not given its due diligence. Imagine yourself read a function name and wondering what the heck does this function do! …

Member Avatar for mike_2000_17
0
186
Member Avatar for slawson01

Please note that your declared pointer is only a character pointer. [CODE]char* pointer;[/CODE] You should delete in this way [CODE]delete pointer;[/CODE] No need for the square bracket as it is not an array pointer.

Member Avatar for nbaztec
0
179
Member Avatar for empyrean

Why not you try to GetChanges() on the modified version of your datatable? Since you mentioned that it is a modified of the original, I guess you should be able to get the changes from 'dtModified' [CODE]dtModified.GetChanges();[/CODE]

Member Avatar for chiwawa10
0
179
Member Avatar for YingKang

Please the "using" directive after all include files. Like this: [CODE]# #include "Customer.h" using namespace std; [/CODE]

Member Avatar for Stefano Mtangoo
0
128
Member Avatar for shoeson

Instead of escape characters, you can use the '@' symbol before the string. E.g. @"This is "an" example of 'escape' characters"

Member Avatar for chiwawa10
0
86
Member Avatar for tsotne1990

Are you missing the include header directive in both of your CPP files? It looks something like this: [CODE]#include "GradeBook.h"[/CODE]

Member Avatar for chiwawa10
0
81
Member Avatar for corby

It seems to me that your copy logic is not right. [CODE]//copy linked list while(curr != NULL) { node* copy = new node; copy->info = curr->info; copy->next = NULL; curr = curr->next; } cout << "The list was copied."; [/CODE] Observations: 1. You do not have a pointer to point …

Member Avatar for chiwawa10
0
196
Member Avatar for jeffpro

Based on the code posted, I assume that it is running on the main thread. Calling Sleep() from the main thread causes the program to pause for the specific amount of time. All others background threads will still be running and doing some work. If you need some background work …

Member Avatar for chiwawa10
0
119
Member Avatar for rgutierrez1014

[CODE]while (!cin.eof()) { cin >> value; list.insert(value); }[/CODE] It seems like the program will store whats in the variable 'value' when Ctrl+D is encountered. Apparently, at the point of Ctrl+D, the final valid value stored in the variable 'value' is 5 which is then inserted into the 'list'. That is …

Member Avatar for chiwawa10
0
109
Member Avatar for kashifboy

Human tend to be creative and bend the rules. There is no way to be sure that the input you received is in integer format. The best way is to read line and then try to parse the string into integer. E.g. [CODE] #include <stdlib.h> int i; char num[256]; cin.getline(num,256); …

Member Avatar for Narue
0
100
Member Avatar for waphon

Care to explain what is the first post (the image) about? Is it some kind of assembly function capability?

Member Avatar for chiwawa10
0
116
Member Avatar for alcx88

There are several mistakes in your code. I have corrected them and look out for the comments in the codes below: [CODE] #include <stdio.h> #include <stdlib.h> #include <ctype.h> #define MAX 100 int main(int argc, char *argv[]) { int i, j = 0, sum = 0; int a[MAX]; // i start …

Member Avatar for chiwawa10
0
108
Member Avatar for hsquared

By implementing a binary search tree, it is presumed that the key value is sorted. In your case, the 'id' is sorted. One thing to note about your implementation is that, the stopping condition have to be check first. If the 'id' is not found, then check if it is …

Member Avatar for chiwawa10
0
103
Member Avatar for NewLegend

Here's an example of working linked list. Basic functions such as add to list, clear list and print list elements are provided. Hope this helps you to understand better. [CODE] #include <iostream> using namespace std; struct input { int id; // current id input *next; // pointer to next input …

Member Avatar for NewLegend
0
197
Member Avatar for applepomme

Do note that this will only write one Matrix into the file. [CODE]stream.write((const char*) &myMatrix, sizeof(Matrix));[/CODE] Just replace the pointer of myMatrix to the location of your matrix array and the size to the total number of matrix multiply by sizeof(Matrix)

Member Avatar for chiwawa10
0
191
Member Avatar for hurbano

There are other errors as well. Your firsttry variable are calling the methods wrongly. [CODE] int main() { MyBST firsttry; firsttry.add("name"); firsttry.display(); while(true){} return 0; }[/CODE] The add function needs 2 parameters and there is no display function defined for MyBST class. Here's a working piece of code: [CODE]// TreeNode.cpp …

Member Avatar for chiwawa10
0
134
Member Avatar for solitaryy

Let's see what you've got worked out so far. Show your code here and many will be willing to help.

Member Avatar for chiwawa10
0
93
Member Avatar for alcx88

Your logic for comparing palindrome is wrong. Palindrome ignores the placement of spaces. It only cares about the reversal arrangement of letters. You could use the reverse string function as below: [CODE]char* ReverseString(char* oriStr) { int cnt = 0, i = 0; int len = strlen(oriStr); char *revStr = new …

Member Avatar for chiwawa10
0
96
Member Avatar for skecher

Explaining the differences between C and C++ in this thread is simply insufficient. It is better for you do look up other resources on the Internet. [URL="http://www.cprogramming.com/tutorial/c-vs-c++.html"]http://www.cprogramming.com/tutorial/c-vs-c++.html[/URL] [URL="http://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B"]http://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B[/URL] [URL="http://zarrata.com/durofy/computers/programming/10-major-differences-between-c-and-c/"]http://zarrata.com/durofy/computers/programming/10-major-differences-between-c-and-c/[/URL] C++ is the superset of C. One of the major difference is that C++ supports object-oriented programming while C does not. …

Member Avatar for chiwawa10
0
93

The End.