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

The next bug is at line 15 -- feof() doesn't work the way you think. Instead, you should code it like this (which will only work with text files. binary files are coded differently because the EOF character could be a valid character in the file.):

while( (ch=fgetc(fp)) != EOF)
{
   fputc(ch,ft);
}

Another bug: failing to check that the two files were successfully opened. If the source file in argv[1] doesn't exist then no point attempting go open the output file and copy. And if the output file can not be created pointer ft will be NULL and the copy loop will fail causing segment violation.

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

I always wanted to visit Austrilia because when I was young there was a weekly TV show about the huge wildlife preserves with kangaroos, elephants and other exhotic animals that we can only see here in zoos.

The second place is Holland in the springtime when the tulips are in full bloom.

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

I'm not aware that portablity to other platforms is an issue in this thread. But if it is he can also use preprocessor directives to control which sleep is used

#if defined(_UNIX_)
usleep(1000); // sleep 1 second
#elif defined (_WIN32)
Sleep(1000);
#endif
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Hello, Sanjay! Welcome! :D

Better a year late than never :ooh: I think everybody knows this DaniWeb Icon by now.

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

>>If i do this, i think that it'll be running (Use cpu resources) but doing nothing...
That is correct -- and which is the reason everyone uses os specific sleep function. There is no other way to do it without consuming lots of cpu resources.

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

I like to use wcstombs() because it is pretty easy to use. There are, however, other more powerful fuctions that may be better used for some languages such as Chinese.

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

They'll probably tell you to never use goto as well, but that doesn't mean you should just listen to them. Find out why, and then do what is best; and yes, the popular opinion can be wrong sometimes..

Most, if not all, professional programmers refuse to use the goto statement, and most companies will not allow it. If you are just learning programming for yourself and for the fun of it then by all means do whatever you want. But if you ever intend to make programming a profession then learn the best forms of coding and what to stay away from. Never use goto and never use void main(). Learn that now the right way and you won't have to unlearn it later in a couple years or so.

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

Not a good idea to use doubles in switch statements because they are often inprecice due to the way they are stored in memory. If you really have to use switch instead of that if statement then you should multiply it by 100 then assigned the result to an integer. Be careful that you don't get data overflow errors doing that.

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

>> This may be a solution only for a very short delay, less than 5 milliseconds.

How is that ? It is a solution for any length of time. If you want more accuracy then other a different timer, such as the clock() function. It is not possible even with sleep() to get any more accurate. You could delay the program for hours and even days with my solution. True, sleep() is a much better solution because it doesn't take up so much processing time.

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

There is no scientific proof that God exists or even what God is. But there is proof that Jesus Christ exists 2,000 some odd years ago and according to Him He is the Son of God and God indeed exists. We can't prove Ben Franklin existed either but we know he did from his and others written word.

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

>>this will have to be something that ALL christian sects believe
1. Jesus Christ was born, lived, died, raised from the dead and ascended into heaven.

2. The goodhood consists of three members: God the Father, God the Son and God the Holy Ghost (AKA the trienity of the goodhood).

3. The only way to get to heaven is thru Jesus Christ.

4. We are all sinners and require God's forgiveness to get to heaven.

Those I think are the basic principals of Christianity that all denominations will agree with. From there beliefs diverse significantly, for example I don't believe in the literal interpretation of the Bible. The earth is certainly much older than the 6,000 years many Christians believe it to be. And the earth was not created in 6 earth days but 6 of God's days, which could be millions of earth years.

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

Ancient Dragon, I noticed you gave me bad rep for agreeing with jwenting. How is it all lies?? And I've done research myself on this.

read what I posted and you will find out. Fortunately bad rep doesn't really mean much here in Geeks Lounge. I would not have done that otherwise.

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

Who did the research?

follow the links I posted. They are only two of many many recent studies.

How can you be certain it isn't biased or contaminated?

I can't. You'd have to make up your own mind.

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

Does it matter how long the delay is? You can use time() to delay for a specific number of seconds. You need one time_t object and set it to the current time. Then enter a loop until the value returned by time() minus the original time equals or exceeds the desired delay number of seconds.

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

The worst of those excesses are the so-called "Gay Pride" parades, filled with homosexuals performing lewd acts in public and walking around naked or in their underwear, all in the name of "showing that we're normal well adjusted people".
Hear this, faggots: if anyone BUT homosexuals did anything like that they'd be arrested for indecent exposure and lewd behaviour instantly and probably end up with a hefty fine, maybe jailtime, and almost certainly forced psychiatric treatment.

I certainly agree about the gay parades, but they are not unique here in USA. We also have mardi graw parades where everyone gets plenty drunk, wears awful costumes, and dances in the streets. Then of course is Saint Patrick's Day Parade where grown men dress up as little elves in green costumes.


Your insistence that sex with young boys is perfectly alright as long as it's homosexuals doing it is another farce. You're perverted pedophiles. Now not all homosexuals think and act like that, but enough do to make the entire group look bad and from their numbers it sure looks to be the majority.

All lies. That is a false myth. Research has proven it to be false. You should read a little before spouting off your mouth about something you know nothing about.

And oh, if you insist you're not homosexual by choice that means it's a mental disorder. That (combined with your tendency towards pedophilia) disqualifies you from ever …

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

yeah... i thought you were a girl too... heh

holystyles avator looks male to me.

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

wait... she has a baby? i had no idea... lol

Yes, just a few months ago. And I'll bet you thought she was just a crabby old woman :)

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

catsup and catchup is the same as Ketchup? :?: the tomato sauce?

Was just wondering :-/

Yes, they are the same thing. Read this article.

Sulley's Boo commented: Thanks! +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Here is a good article on why banning guns in usa will never work

If banning guns worked, Washington, DC and New York City would be the safest cities in the country. Since 1976, it's been illegal in Washington, DC to own any handguns or to keep any type of gun in your home unlocked and fully assembled. However, Washington, DC is the "murder capital of the United States."

New York City has had severe gun control laws since 1911, yet it also ranks among the most dangerous places in the country. In both cities, violent criminals can easily obtain the most deadly weapons on the streets within minutes.

A national gun ban won't help. With an estimated 220+ million guns now in the US, an unpoliceable 12,000 miles of borders and coastlines, and the world's largest stock of precision machine tools, criminals will always be able to buy, steal, or make guns and ammunition.

A competent backyard mechanic can build a rifle or handgun. Even Afghan peasants, using tools considerably inferior to those in the Sears catalog, have built machine guns capable of firing Soviet AK-47 cartridges

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

The URL given above is showing - Video is not available....

The link works ok for me.

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

>>what i want to be sure is, after function statements does the allocation space dissapear

Yes because you sent the pointer by value and not by reference. You need to send a pointer to a pointer which requires two stars not just one.

Allocation(&ucBufr);


void Allocation(unsigned char ** ucBufr)
{
        /* nDataSize and ucData is got from a file here. */
        *ucBufr = malloc(nDataSize);
        *ucBufr[0] = 'B';
        *ucBufr[1] = 'U';
        memcpy(*ucBufr+2,ucData,nDataSize);
        /* ... */
}

>>local variables which are defined in the function are freed by the O/S
The OS does not do that for local variables but it will for memory allocated by malloc() -- local variables are freed by the program itself when the function returns to its caller and cleans up the stack.

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

This seems to be a promising link. I only quickly scanned the article but looks like it has some code. google can be a programmer's best friend sometimes.

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

I don't like catsup on either eggs or fries but I know a lot of other people that do. The only thing that goes on an egg is a muffin.

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

Even so, where is she? I haven't seen her here for awhile. Sad.

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

The value of x is uninitialized, and the value of y should start at 1 not 0. It might be better to use a for loop instead of a while loop.

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

Yes you are right. My link was not what I thought it was. Well, your link does not show USA as #1 either -- its 4th. So Josh's boast is still incorrect.

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

>>i'm just trying to check my code u all if it's correct
does it do what its supposed to do ? If yes, then its ok. If not then you need to fix it. One problem though is that your program will produce data overflow errors if the value of n is too large.

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

We are not a software factury where you can get the answers to all the programs you teacher might ask you to write. Think about what you are required to do then write an outline of the program. After that you should be able to code the program. only when you show us your work will we help you.

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

Adsolute GDP in pure dollars is almost meaningless unless compared with the population size. Sure USA has hightest GDP in pure dollars. But in 2002 there were 6 other countries that had higher GDP/employed population. This is like saying USA has highest crimes in the world, which we do if you count raw numbers. But when compared by crimes per 1,000 population we are 24th in the list..

There are three kinds of lies: lies, damned lies, and statistics

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

simple -- redraw whatever it is that you want on the screen.

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

>>We have the highest gdp for a nation of this size
USA -- ranked #7

>>and virtually no unemployment whatsoever
Unemployment rate: 4.6 in 2007. ranked 95th (the larger the number the better, there are 94 countries with worse unemployment rates than the USA, and there are 28 or so with better (depending on how you want to count them.)

Olympic Medals/Population: USA ranked 46 Australia: 4

>> Our economy is far superior to any other nation..
Considering the facts I posted above you should be more careful about being so boastful. Get your facts straight first.

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

America is pretty low on the list for health care -- 37th on WHO's list with France #1.

Mortality: again America is in the 24th on the list of countries.

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

i didn't know about c graphics,unix,linux.but with my knowledge i want to do a project.can i ?

Forget about doing any projects for now -- juist concentrate your efforts on learning the language. You can read books (see your local library for free copies), get online e-books, or read links in the Read Me threads at the top of this and the C++ board.

SpS commented: Right Suggestion +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

i want my program to be platform independent.
it should be working with windows server and linux.
more over i dont know anything about DDK can you help me?

sorry i have poor grammar forgive me.

I have not written one either, but you can get help from these google links.

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

But like everyone else points out it's kind of nonsense, because 1. why would you ever need to do that anyway? Obfuscation? other than that I can't think of anything. and 2. it's contrary to the standard.

and 3. he has an idot for a teacher.

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

But you can never achieve the oridinal number of digits even when you set the precision to something larger, such as 30. The most cout will display are 15 digits. Probably have to use some other math libraries, maybe boost, for that huge number of digits.

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

I hate it when teachers teach undefined behavior. :angry: The value of j will depend on the compiler you are using because the language does not define the behavior of i.

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

> I like it a lot and does everything that you are complaining about in the quote above.
Of course it supports all of it AD, every commercial game out there has been supporting those _long_, time back.

Yes, you know it, I know it, and apparently everyone else knows it too except the OP.

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

the 14th didn't void any amendments. But it did void and make unconstitutional many state laws, mostly states of the south. Wikipedia has an interesting article about it.

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

>>can't find any that work
you didn't look very hard. Re-read my previous post because I gave you two. You will not find a function names "paintComponent" so no point looking for it. If you want to use c++ for gui then forget what you learning in java and learn the c/c++ way to do it.

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

>>Having a smoking section in a restaurant is like having a peeing section in a swimming pool.:*

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

And thus not the 1st...
IMO the 14th is restrictive of individual rights and therefore unconstitutional .

Impossible. The 14th amendment is part of the constitution and by very definition can not be declared unconstitutional. It would require another amendment to abolish it.

BTW: you sure seem to know a lot about US politics for someone who does not live here. Was you educated here ?

>>I do not think religion should be taught in public schools, because it is already taught at a college level.
That might be ok if everyone attended college. But they don't. Kids need a basic understanding of the different religions a lot earlier than 18 years old.

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

>>The program works
No it doesn't.

you use gets() all over the place. Try entering some text that is longer than the buffer can hold and you will find that your program doesn't work afterall. gets() will just scribble all over memory with the extra characters and cause your program to crash at some point. The solution is to use fgets() instead to limit data input.

line 30: parameter to gets() is wrong.

in main() variable i is apparently being used to mark the next available slot in the prson array. But then you use i again for several other reasons. I think you need to set up a different variable for that purpose and not use it for anything else. You also need to verify that you don't try to enter more than 20 people because that's all the array can hold -- if you add the 21st person your program will crash.

As for your original question -- I think you need another menu option to show records for only a specific person then prompt for that person's name. Then its a simple loop to search the array for the person and print it when found.

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

I told you that I didn't disagree with you...?
.

Oops! I misunderstood your statement.

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

>>To the extent that if no are not atheist you cannot hold elected office?
Of course relegious leaders can hold elected government offices just like anyone else. What I meant was that they should be prohibited from preaching politics at the pulpit or practicing their religion at official government functions and meetings. Fortunately I don't think we have ever had very many such problems -- a few but not very many.

>>[public] Schools should not teach any form of religion at all..
Why not? Don't you think people should know that religion exist in this world ? Students need to know that there are Christians, Muslems, Hindues, etc. Religion is part of the history of our planet and should be taught in history just like everything else.

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

>>complete abolishment of religion in government
Yes, I agree with that. There should be a wall between government and religion -- one should not cross the boundries of the other. The government should stay out of the church's business and the church should stay out of politics. Times have changed -- religion no longer has any place in public schools or in government. There are just too many different religions here to allow public school teachers to teach any one religion -- teaching about religion is ok as long as it is not conflicting with other people's beliefs.

>>or not even limiting states' ability to establish each own's state religion
The first amnendent certainly does prohibit states from doing that.

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

What the game needs that doesn't work anymore:

- The full screen, not a window.
- Specific pauses (not delayed activations) for time intervals.
- Keyboard scanning during the pauses, to detect an answer being input.
- Sounds generated instantly by the program to reflect what is going on on the screen (not canned sound clips).
- The ability to draw objects differently, based on what the user does (not canned images).
- ONE path of execution in a definite order, not multiple spawned processes

I just found and started playing a new game Dungeon Runners on Vista Home edition. I like it a lot and does everything that you are complaining about in the quote above.

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

Of course... I don't disagree with you at all.
I don't hate gay people because like I've said before, I have a couple of gay friends who I care about a lot.

I did not say, nor mean, that you hate anyone. And I don't think you do. There are, however, a lot of people out in the world who do hate others based on the things I mentioned. Now if you re-read my post with that in mind I think you will probably agree with what I wrote.

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

It depends on the compiler and the operating system. You can use an os-independent compiler such as QT which as gui support for *nix, MS-Windows and MAC (others I don't know about). Or you can use os-specific libraries such as win32 api function and MFC class for MS-Windows. There are libraries for *nix too but I forget what they are.

I think that is one reason why java is supposed to be platform independent. As far as I know there really are no similar c++ compilers that produce platform independent code like that. Microsoft .NET Visual Studio is headed that way but may be several years away from achieving that goal.