WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Stop using fscanf() and use fgets() instead. fscanf() is not good (nor safe) the way you are using it. Especially with postal codes. Since you are using the data as a string, you didn't leave room for the ending '\0'

Also, read this about scanf() , which applies to fscanf() too.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Boy is this thread full of BS :D

1) cstdio is not deprecated. It is the C header for C functions fully allowable in C++. You don't deprecate a language... C is a language, not an old set of functions for C++. If you can offer a link stating otherwise, please do so.

2) It is better to use C++ I/O functions in C++. But C I/O functions are allowed -- although it is best not to mix the two, because they do work differently. If you use getchar(), use C input functions throughout the code.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I was always good in math, and was surprised to learn that in my computing life math was rarely needed beyond the basics. When we needed higher math we were generally given the equation which had to be translated into code, but that wasn't too hard. Pretty straight forward most of the time.

So for me math wasn't really necessary.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

yeah the americans pronounce vase like case by we say it like cars

Why? There's no R in it? :)

And you say shed-jual and al-you-min-ee-um,
we say sked-jul ('U' like YOU) , ah-loo-mi-num.

Interesting, wot? :mrgreen:

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

white

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

the impossible is

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

the caves around

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Argent's "Liar" done by Three Dog Night

I've actually got a couple that go the other way. Springsteen's "Blinded By the Light" is rotten, but Manfred Mann made a great cover of it.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Calvin & Hobbes
Wizard of Id
Arlo & Janis
Dilbert
Peanuts
Bloom County

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

hi, it is ok..
but now if u see Flash is the most powerfull tool used for web development..

In my opinion, I must disagree. Potential flame war first shot -- proceed with caution! It is extremely useful, true, but it is over-used and IMAO should NEVER be used to create a website, only to enhance one. If I need information from some Flash site, I have to screen capture the window and reedit to use a graphic or run the dang thing thru an OCR translator to utilize the information. Not to mention having to wait while the page itself loads.

Flash should be used to enhance a site. In place of a picture, you put flash animation, interactive data, basically use the power it contains in conjunction with a webpage, not in place of a webpage. End possible flame -- please don't kill me! it is just my opinion

So I woud request u to Kindly give a seperate Category for flash.. so that it will be easy to Communicate ..

But as Dani already said, few want to communicate at this point. If there is more communicating going on, having a flash forum makes sense. At this point, a forum with 1 poster is a waste. Drum up some more business, get some people in a discussion, and I'm sure with more traffic a dedicated forum will happen.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

The code is above!

You mean after all these suggestions you haven't made any changes to the code you posted? No wonder it's not working. :rolleyes:

John A commented: What the heck, you deserve some more rep after all your hard work... --joeprogrammer +8
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Answered in other forum site.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Two things:
Please format your code. It's very difficult to follow.

And you input is not working the way you want it to. This series explains what is happening to you. cin and scanf() are really the same command. The first problem I noticed is your cin >> choice; command. The character description in the link above should tell you what's going on.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

ever onward toward

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

theory left for

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

hilt

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

The corrections print out each word of the sentence entered on a seperate line. One word per line. I am trying to get the program to remove multiple spaces entered between words but print out the new sentence with only 1 space per word (all on the same line). I still think there may be a problem with my loop.

Probably. But I don't think anyone here has perfected psychic debugging yet. Without knowing what the code looks like, what can we say?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

snark

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Immediately upon entering, wipe your feet.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

of the past

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

and sour grapes.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

First thing is for(int x = 0; x < (strlen(a)+1); x++){ will blow your array boundaries. You definitely don't need the +1 -- and probably want something like x < (strlen(a)-strlen(b)) instead.

Then you need a loop within a loop:
Search through a looking for 1st character in b.
When you find one, start another loop that tests the next values in a to see if they are the same as the rest of b

3rd, give your variables better name. Learn to make the names have meaning -- it will help as time goes on.

Last, use CODE tags.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I was obviously too subtle about CODE tags in my previous post. So, please use CODE tags!!! Instructions are on the background of the input box where you are typing your messages, or you can look here

this is what i came up with and which makes the most sense to me but my compiler is still giving me errors so i dont understand wut is wrong now

Neither do we. You get errors. Maybe you can tell us what the errors are? This way we don't have to guess and probably be wrong.

We would love to help you. But you need to give us as much info as you have. We're not in front of your computer, only you are. Details are important.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

what do you mean grade, i am new on the site:-|

Will you get the A on his assignment? Or more to the point, using your answer, does he deserve the grade he gets?

IOW, we would prefer to help the poster find the answer, not do his homework for him.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

How come on this line:
bool FoodList::searchByName(char name[],Food& foodItem)const

you used the [] after the name and not these ?()

That means name is to be used as an array in the function.

Joe head is asigned to a NULL. Does NULL mean is a empty paramiter?

Yes.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Being the age that I am, and first getting into Star Trek while in college a couple of years ago, the original series is just too corny.

Maybe by today's standards, but when it first hit the airwaves, man it was the greatest!

I like both Kirk and Picard but for different reasons. Picard was a better captain, more sensible, and Kirk was the bad@ss.

But in ST, there is no way the Captain, 2nd in command, Chief Engineer, and Chief Medical officer would ever go into a potentially hostile environment together. Hence, TNG had a more realistic concept. But the difference was ST was an adventure and TNG was a drama.

As for Enterprise, their first mistake IMO was too many aliens. They should have only met a new alien a couple times a season. Our quadrant didn't seem to have that many alien species for us to discover that early -- and by the time ST era most were forgotten! And we were too new to the extra-solar travel to find that many.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Life, don't talk to me about... wait I did that one already.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

remove our pants

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

right to squander

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

snurt

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Well, even though you didn't use CODE tags prominently explained on the background of every input box you've typed in so far, the problem with your code is you didn't even try to do anything yet. There's no read attempt at all.

The idea is for us to help you with your program. There's nothing here for us to help with.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

U just hit Ctrl-Alt-Del ;)

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

It seems that on line 10 you forgot to use the index onto your string array, so your bleglelstar gave a wrong gringledor 4 lines later.

In other words, help with what? Don't you have to show us what's wrong, or are we supposed to write it for you? ;)

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

You don't need PI nor circles, just the distance formula, as SOS mentioned in your duplicate post.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

i am a newbie in C++ file processing...
Any1 can guide me to search for an item(lastname) in the example below?
what is seekg or seekp... how to use it?

Not a clue what you are asking. Maybe you need to explain the problem. Remember, we're new to it so details will help.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Okay, but it doesn't seems to have any easy-to-use compiler.
Is there any compiler that is just compile *.c format file instead of so many functions that makes itself more complicated than it's already is?
Thanks.;)

I don't understand this question at all. What compilers don't compile *.c format files? What functions don't you want?

If you don't want to use functions, then don't. No one ever said you have to use the ones that come with the compiler, but I for one would rather use their I/O functions that write my own...

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Thanx for the help but the problem is my complier doesn't do too well with getchar and gets.

Your compiler works fine with getchar() and no one should ever use gets() . Please don't blame the compiler because you haven't learned all there is to know about how input works. It takes time and experience. You have to keep in mind that even the ENTER key is a character.

I tried doing that but it didn't work.

No enough of an explanation. Can't help you fix it without details.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

You need to calculate the distance from (x1,y1) to (0,0). If < 1.0, you have a hit.

And please use English, as the Board Rules request. This is not a chat room.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

OK, now that you've done his homework for him, will you get the grade for the program? :rolleyes: You both need to read this, and this

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

and don't mix stream io with oldstyle io.

Meaning, use C++ style only, don't mix with getchar(), printf(). IOW, anything from stdio.h/cstdio.

In an attempt to have cleaner code to work from with my next assignment, I made your suggested changes as well as a few more...

If you post it, we can look at the code again. Maybe there's more stuff -- like main() needs a return statement.... ;)

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I would do it like this:

1. Ask the user for file name of file they wish to write data to. 
2. Store file name in to a variable.
3. Open file. 
4. If file not open 
      issue an error message
   else
      Start a loop:
      A. Enter user data. (implies ask/accept)
      B. If finished, exit loop (5)
      C. Write data to file 
      D. Continue loop
5. Close file
Aia commented: Very clear. Aia +1
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

There are some folks who might not know what graphics.h implies. It would be waste of time for them to explore this question.

That's true, but the poster specifically mentions graphics.h, doesn't he? Therefore, shouldn't the answers help him with it rather than tell him he's wasting his time? He obviously isn't because he has the technology in question. :rolleyes: You may not be aware of it, but there are still programmers alive that know the technology that existed before you were born. We're not all dead. We've just gotten older. :cool:

As for you, I am very glad you are so knowledgeable about Turbo C. I challenge you to supply a satsifactory answer!

Fine, if I get a suitable question, I will. But I really don't need your permission. I would help anyway. :p

Don't be such a jerk. This is a professional forum, not one where a new poster can dazzle us professionals with his limited knowledge. If you can't help, allow someone else to do so without denigrating the poster... ;)

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

For all it matters i have access to GCC and Visual Studio 2005....

I don't want something extremely advanced....Some basic menu functionality {with options, back and forth for navigation, and exit option...}

The standard library doesn't provide anything, concerning the console?

Not in the compilers you mentioned, just basic input and output. You'll have to get into the Windows API's (http://MSDN.com) or a text graphics package of some sort.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

or the wretched

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Him and her is a lousy way to start a sentence.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

starch

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

we distill water

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I completely agree. Call them every few days to get an update.
As for:

  1. Keep contacting the owner of a business feverishly until you secure the job.
  2. Keep contacting the owner of a business until you are told : "No, now GO AWAY!

This must also be tempered with good sense. Again, every few days... Every day may be too much, only once is too little. Just enough to show major interest and stick-to-it-iveness but, as has been said, don't be a stalker...

mattyd commented: help with advice # Thank-you ___ MattyD +5
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Graphics.h? Let me guess, must be from the old Tubo C compiler (16bit), good luck to find anyone that uses this old bird!

Out of curiousity, why bother mentioning this? It a useless post to the user for 1, and a slight against those of us that have the knowledge to help him. Wouldn't it be best to give encouraging information rather than just telling someone their tools suck? Which they don't, of course. Turbo C works fine... :-|

I'm just waiting for a better explanation of the problem.

bumsfeld commented: Nasty answer! +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Unfortunately, that doesn't clear up the explanation. I still don't know what he means.

Maybe switch to FireFox... IMAO it's better anyway.