Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>what program will use with to problems....

That doesn't make a lick of sense. I hope English is a second language for you. If English is your mother tongue then you need to go back to grade school and learn how to write a proper sentence.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>line 38: return main();

Never ever under no circumstances should you make recursive calls to main(). That function is to be called only by the operating system during the program's initial startup. When you want to repeat something, like that menu, use a do or while loop.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

lines 5 and 7 are do-nothing lines. The don't do a damned thing. You could delete both lines and the loop would work the same way.

>>//resets command to null
Says who???

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

There is no "best", nor can there be.
Not only don't you supply any criteria to use in defining "best" that can be scientifically measured, you don't know all games out there so can't even apply those criteria to every game in existence in order to see how well it matches them.

One way to define "best" is through sales. The game that sales the most copies must obviously be the best. If it was a lousy game than very few people would buy it.

By looking at the shelves at the WalMart store where I work I would think PC games are not very popular any more. There are a lot more games for WII and XBox.

IMHP "Diablo LOD" was the best game in its time. Don't play games any more so I can't comment on current games.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I love Quaker Oats instant oatmeal with Silk soymilk. Occasionally I will go to Denny's restaurant and have pancakes.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I am using char * for getting data from the user. Now, if i just do

char * data = new char[100];
cin >> data;

The data is corrupted, i.e. only data before whitespace is stored; and the following is an example result:

enter: "Microsoft Co."
data: "Microsoft"

Can someone tell me why this thing happens?

It has nothing to do with dynamic memory allocation. The >> operator stops at the first white space. If you want text that includes spaces then you need to use getline(). Using std::string is preferred but you can use character arrays too. cin.getline(data, 100);

Also, secondly, I want to avoid declaring a size to the char *, since i want the input to be flexible. Now, the following code says that the 'data' is not initailized when executed:

char * data;
cin >> data;

Any idea how to come around this?

Thanks!

Your compiler is correct, you can not use a pointer before it has been allocated, as in your first example. The solution you are seeking is in std::string. With that class you do not need to specify the string's length, and can be used almost exactly like a character array.

std::string data;
getline(cin, data);
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

No idea why it doesn't work. What does it do that it is not supposed to do? Or what doesn't it do that it should?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Does that mean she threw her throw towards the little prince?
Wonder who the next Queen will be?

I certainly hope it is NOT Charles's wife -- she is such an ugly (female dog). There was a picture of William's girl in the tabloid and she is a very good looking woman, one that might be worthy to be Queen.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If the customer structure does not contain any pointers then you could write the file out in binary mode so that fseek() to any given record position would be possible. Something like fwrite(fp, &Customer, 1, sizeof(struct customer)); Then read it back the same way but using fread() instead of fwrite().

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>I have worked on this program and cannot figure out what keeps happening.

You will need to explain the problem in more detail if you expect any help. What is the program doing that it is not supposed to do?

Is there a reason for the { on line 40?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I found that visual studio has ~2Gb limit as an application.

That is the limit of all 32-bit compilers, not just visual studio. Install a 64-bit compiler (vs express doesn't support it, so you will have to buy it) on a 64-bit os and the limit will be a lot larger. I think, but not sure, that g++ and gcc will compile 64-bit programs.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 20: Whether that line succeeds in connecting to your printer will depend on the printer and operating system. I have an HP Officejet laser printer on USB (Windows 7) and that line failes to open it.

line 24: you are sending a binary number to the printer. Printers do not know how to print them. The number will have to be converted to text before sending it to the printer.

char text[20];
sprintf(text,"%d", i);
fputs(text, printer);
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>if(type=1)

Use == operator, not the assignment = operator.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Why is that a recursive function ??? A simple loop with the mod operator % (to find out whether the number is even or odd) will do the trick. No point in overcomplicating that function unless recursion is required by your teacher.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>void arrays::Talk(hold&, keep&) {
from line 5. You need to add the data type of each of those parameters, such as void arrays::Talk(string &hold,int &keep) { >>a.Talk(feelings&, array_size&);

Remove the two & symbols.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You need to use { and } between the if and else statements

if( something )
{
   // code here
}
else
{
   // more code here
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Since its a linked list you can not access the nodes in the for loop that you posted, but since you already marked this thread solved I suppose you already figured that out.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

why are you opening the same file twice (lines 11 and 22) ?

fseek() does not work well with text files.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

@romarie: we already told yuu integers will not work because they can not hold large numbers. Either use a character array or a linked list of digits, both have already been suggested.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

how is slistelem declared?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>Hi, i am doing my mom's c++ for engineering class,and doing a project for her,
So you are helping your mom cheat??? Bad idea. Does she do your homework for you? (Probably not). How do you expect her to lean anything if you do her work for her. or do you expect to do that too?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>> if (temp == c)

Your compiler is correct. Variable c is a single character, not a character array. Maybe you mean if (temp[i] == c)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

More than likely the same problem as other very old compilers, such as vc++ 6.0. Upgrade the compiler -- VB 2008 Express is free, but I don't know if that version will do what you want it to do.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

... when you remember the Queen of England as a young woman.

When you watched her coronation live on tv.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You mean after you re-start the program? The way to do that is to make the program open the file and read the value of the variable(s) that was written. If the file does not exist then the program should do nothing.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Right so you can store 1 byte in each character

Something like that, but you store a character in one byte, not the other way around, but that has nothing to do with the topic of this thread because this thread is about integers, not character arrays.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If you have an array of 4 characters, then you have 32 bytes...
?

No you don't. What you have is an array of 4 bytes -- one character = one byte.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You will have to write your own functions to add and subtract strings because those numbers are too big for normal integers. The solution in Turbo C will be no different than for any other C compiler.

And don't ask me to do your homework without depositing a very very large sum of money (at least six figures) in my PayPal account.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Without being more specific as to what you want, just read this. It will tell you everything you need to know about that function.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

DWORD is not a standard C or C++ data type -- it is defined in windows.h. But if you want to use it without windows.h then you will have to declare it yourself as anything you want. For consistancy you might want to declare it as typedef unsigned long DWORD; . But that is no guarentee that it will be a 32-bit integer because the standards do not dictate the size of integers. Compilers are free to make them any size they want. So if that is a question you were asked then the answer is that there is no standard solution.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

why don't you just use sprintf()? With sprintf() you can do all that in one line of code. Do not put spaces in the date string because many programs have problems with the spaces, and arrange the string so that the file names can be easily sorted using Windows Explorer or some other program.

char filename[40];
sprintf(filename,"%04d%02d%02d", timeinfo->tm_year+190, 
    timeinfo->tm_mon,timeinfo->tm_mday);

>>file.open((const char*)g, ios_base::app);
The typecase is unnecessary.

>>if (!file) cout<<"error"<<endl;
It's good that you make that check, but if open fails then don't execute the lines that follow. So you should code this:

if( !file.is_open() )
{
    cout << "error\n"; // endl is unnecessary
}
else
{
   // do something
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster


Besides if he is using C++ compiler he won't be able to compile unless he uses the cast.

All the c++ compilers I know of will also compile C code. Just name the file with a *.c extension instead of *.cpp or *.cc.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Dani and Narue are the same person. My evidence is that they are both women. I submit this to all of you so you can congratulate me.

What makes you think Narue is female? (s)he admits (s)he is a witch, so (s)he could be either or both. :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

First of all the while loop is incorrect. Note that the insert() method is not neeced because simple concantination is all that is needed.

while( inputFile>>baseSentence )
{
    str1 = str1 + baseSentence + " ";

}

An even better way to do that is to replace that while loop with getline(), assuming the sentences are all on the same line. getline() will preserve all the white spaces.

getline(inputfile, baseSentence);

You did not post initialCap() function, so I can't help you with that.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

very simple -- read and discard all the numbers up to the one you want to keep. A loop will be handy for that.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Narue = Jephthah = Tom Gunn. We never see all three at the same time.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Don't worry about duplication because arrays are always passed by reference never by value. The & operator is unnecessary and sometimes may pass the wrong thing. The way you posted is correct.

I would be more concerned about the 72,000,000 bytes (about 70 meg) of memory that the array will occupy. Accessing such an array can be very very slow especially if the os swaps some of it to disk.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

There's some rhumors over here USA tabloids that Price William, not his father, will become the next King. Any truth to that?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>i want to give a presention on functions use in code
>can any one help me ,as give me these codes?
Wait. You're giving a presentation on something that you don't even know how to do?

Is that so uncommon? The idea is for him to learn how to do it so that me can make the presentation. I did that once for a speech class about 30 years ago -- made a presentation about the evils of marijuana. Didn't know a thing about it except what people had told me so I read every available book on the subject. The final presentation was a lot different than the one I thought I was going to make.

The idea of the above is that if you (the op) don't know a thing about the topic then you had better start studying. Just asking other people to give you the information without you yourself understanding the information will result in failure.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

blobs are nothing more or less than large chunks of binary data. The database knows nothing about the blob's contents, its up to your program to interpret that. Here is one article that may help you.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That link to Turbo C++ Explorer 2006 is incorrect.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>Base * ReturnPtrToANewBaseClassObject()
In base.cpp you forgot to add the Base:: class scope Base * Base::ReturnPtrToANewBaseClassObject()

Carrots commented: Thanks ever so much for your help! +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If you have four points, A, B, C and D, where the first three are in a straight line and the fourth one is not, then I suppose there could be 4 lines. You would probably have to solve the problem in several steps. First make a list of the points in a straight line (given enough points there may be more than one set of these). That may (or may not) reduce the value of N to the number of sets plus the number of points not in any of the sets. Now all you have to do is use that new value, say N1, in the formula you previously posted.

[edit]That's probably wrong, but will give you a starting place to think it out.[/edit]

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The problem is with tutorials found on google, they are written by people who do not have a proper grasp or understanding on the subject, they skim over important information and don't have the real world experience to give real insight.

Oh yes I have to agree with you on that one. Tutorials are only useful in the short term, not meant to provide in-depth discussions of the topic. And often they can be outdated or flat-out wrong. Currently printed books (which sometimes give incorrect information) are preferred.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

hey i dont understand why do u need to develop such an application when u have this things done already in java???

I don't understand why you are replying to a two-year-old thread?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

In that case there would only be one line. If there are 10 points all in a straight line then it would only take a single line to intersect then all.