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 parent's. Anyway as a side note, I don't see any reason why you should declare a variable in the child class having the same name as the parent's.

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?

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 data structures like Stack and Queue which may be a better solution in place of linked list. If you are always looking to delete the last element, you may want to consider using stack. Anyway, it all depends on the problem that you're solving. Happy coding!

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]

[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 the left 4 positions using the operator (<<). Using the results, apply the bitwise OR operation (|) with the second character. You should get the result in a single byte.
For bitwise operations, you can refer to this link [URL="

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 the values. Refer to this link [URL="

[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:"<< name <<endl;
cout<<"Address:"<< address <<endl;
cout<<"Membership:"<< membership <<endl;
cout<<"----------------------------"<<endl;
}
............
[/CODE]

Be careful[/QUOTE]

Your code looks good. But, allow me to comment.
showCustomers() function should not receive an int parameter. There is no need for it. In the loop function, there is already an 'if' statement to check for the customer_id. Hence, when the showCustomers() function is called, all information about the customer is displayed. It's simple as that.

[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();
}
}
break;[/CODE]

[CODE]// Here loop is removed
// int parameter is removed
void Customers::showCustomers()
{
cout <<"Customer Information"<<endl;
cout <<"*****"<<endl;
cout<<"Customer ID:"<< customer_id <<endl;
cout<<"ID:"<< id <<endl;
cout<<"Name:"<< name <<endl;
cout<<"Address:"<< address <<endl;
cout<<"Membership:"<< membership <<endl;
cout<<"----------------------------"<<endl;
............
}
[/CODE]

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

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 problem. In fact, it would have crashed because you are trying to access invalid array index.
A simple modification to your for loop in main function would have solved the problem.
[CODE]
int sum = 0;
for (x = 0; x<10; x++)
{
cout << "Please Enter Your Number :" <<endl;
cin>> a[x];
sum += a[x];
}
[/CODE]

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. When your program crash, MSVC++ will points to the code that causes the error with detailed explanation about what causes the problem.

Release mode is used when you want to produce the final output (that is to be distributed). When compiled in release mode, the compiler will perform code optimization. Hence, you will notice that your application actually runs faster in release mode.

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

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

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 reason is simple; so that you'll know how to process the data and what it means.

Take your sample data as an example, the data "wind_chimes" seems to belong to the same group of data as "1", "4", "30", "12" and "5". To my understanding, the data anticipated here is an integer. But all of a sudden, characters were encountered. So, its really hard to process unformatted data.

Hope this helps.

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

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 is missing.

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 the end is reached (printing the value each node stores as it iterates).

Hope I explains well.

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)

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 careful when manipulating bits. Its not as easily handled as bytes. Good luck!

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 be as follows.
[CODE]
class ChildSavings : public Savings // this is how you introduce inheritance
{
// add class methods and properties here
}
[/CODE]
The ChildSavings class will have all the properties and methods of its parent class. Hope this is what you're looking for.

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 boolean a is false";
break;
default: cout << "Default case";
}
[/CODE]

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 >> name[i] >> grade[i];
if(grade[i] == '\0') // NULL is represented by backslash zero
{
cout << name[i] << "\tNULL";
}
else
{
cout << name[i] << "\t" << grade[i];
}
[/CODE]

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.

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 to separate it from the next statement[/CODE]

Equally, this is done in C# using:
[CODE]Console.Writeline("Regular Horus Worked: " + regularHours);[/CODE]

Hope this helps...

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?

miha2, there's always no harm in trying. As you can see, there are lots of experts in this forum who are helpful and friendly. Like all other threads, just work out the initial code on your own and post any compilation error or problem that you face. All are more than willing to help.

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 (69) after encryption. Its just as simple as adding 3 to the ASCII code and you'll get the correct 'char'. To decrypt, simply minus 3 from the ASCII code and you'll get the decrypted value.
NOTE: do remember to wrap around. E.g. Z comes after A when decrypting

Hope this shed some light to you.

Ancient Dragon commented: exactly :) +34

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 checking. Frankly speaking, I do not see any performance difference. Maybe someone can prove it.

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.

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.

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! I believe all of us here have encountered such situation.