Actually, I didn't test this program, just wondered when I was looking at the way it works as the sample represented above. I am not similar with C code (scanf, printf,...), that was why I haven't...
Type: Posts; User: trongsi
Actually, I didn't test this program, just wondered when I was looking at the way it works as the sample represented above. I am not similar with C code (scanf, printf,...), that was why I haven't...
So would you please explain why doesn't it stop calling itself after received 'z' ? when user entered 'z' as input, the program would meet the base case's condition, how come it lets us enter the...
Is there something weird with this program ? Why doesn't it stop when it gets 'z' as the base case. Here we see the program let user enter the character 'r' after it received 'z'. What is wrong with...
So, int a[4][3], the last element is a[3][2].
When i =3, j = 2, *(&a[0][0] + 4*3 + 2) => *(&a[0][0]+14) = exceeds the array.
I think that it's correct if we modify it as following : a[i][j]...
Thank Salem, I'll go through this vague concept by studying more.
Thank you all.
Thanks all for your help.
To Salem,
<---- and the result will be 1 file merged by 2 files above, or 2 files re-rorted ? If it's 1 file, so we will encounter the memory overflow as the problem I...
Nobody helps me out :( . Is something wrong with my question ?
int main()
{
vector<int> ratings(5);
for(int i=0; i<5; i++)
{
cout<< "enter rating:";
cin >> ratings[i]; // last '\n' is stored on the buffer
The point is that when we read a part of the file, say 1000 / 5000 nodes, and sort that part, and so we repeat that step for 4 other parts. The result we have will be 5 sorted segments of one file,...
Hi every body,
Suppose that someone created a linked list with say some thousands nodes, and he saved those list as a file.
Assume that my computer is poor of resource, and its memory can not...
[QUOTE=chasingxsuns]this is my program----------
rectangle::rectangle(int length, int width)
{
int itslength=length; //you declared a new local variable
int itswidth=width; //the same...
They are all run by drivers, fed with gas, and, most important, their brands are on the way declining to bankrupt. :) is that similar enough ? j/k
Yes, I agree with you. Supporting for the first style seems not very persuadable (just my opinion).
Yes, that was what I based on that to create this class. I do understand you. The one I based on was:
- A structure (or even a class) that defines the nodes' framework
- A Stack class that do the...
Thank you all for your advisings.
But my question was can I have a correct destructor for this class ? I mean, assume if we just let the user enter the nodes for stack without using them (so they're...
Thank you, but I've been learning C++, so I want to understand and practice the part I've just learned.
Hi everybody,
My Stack class here is used to performance a simply task of stack. I modified this class from another that has 2 parts, one is a structure making up the frame of the list's nodes , and...
Yes yes, You're so right. I made some mistakes when I posted these code. However, I meant that those function work exactly alike, don't them ?
Thanks all for your helping.
Well, Thanks Dave_Sinkula.
Are following definition of Overloading Operator Assignment equivalent ?
Why must the second one's return type be MyClass&, not MyClass ? What does it mean with that...
Thanks for your reponses, back to the first question, why does C++ require the copy constructor and overloading assignment operator having call-by-reference parameter. Is the reason I listed above...
Hi everbody,
I'm self-studying C++, so there are some points confusing me. Please help me make it clear:
Consider this Copy Constructor Declaration:
MyClass(const MyClass& myObj);
Why must a...
Thanks for your helps.
I've just figured out the problem.
Since I have nearly no experience with C++, I compiled the implementation file & the app file separately, then opened the app file to run,...
Hi all,
This program works well. The the object of data type of class used to count something.
However, the compiler generated the error when I broke this program into 3 parts:
- The interface...
Yes, Yes, Yes, I got it. Thank you so much.
So, if I want to do so, I must place the argument for mediate(record& student) function, is it correct.
I'm appriciated.
/* Solved problem
BIG...
This code doesn't work as I expect. The return value of privte member variables are always garbage . :confused: :confused: :confused:
Can every body help me out !
Thanks in advandce.
/*...