Jump to content
  • Advertisement
Sign in to follow this  
Avont29

array error

This topic is 4845 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

can someone help me, i made an array made of bad words, i declared it string BadWords[]= "(explicit)" if ( name==BadNames[]) //when i put this code, it keeps saying expected primary expression before ']' token, i changed it to if ( name==BadNames[0]) but the program shut off or something, why can't i check to see if name = BadNames[] it won't let me check to see if name is equal to any of the elements in BadNames, i've checked over and over, and tried to see what the prob was

Share this post


Link to post
Share on other sites
Advertisement
Seriously, this should be the last drop. Someone just complained that this guy was posting too much, so the reply of Mr. Avont29 was the following:

Avont29 Member since: 6/22/2005 From: Richmond, United States
Posted - 8/12/2005 11:42:11 AM oh, ok, sorry about so many posts, i'll keep it down, and i'll fix my code on my own, i don't need your help, heh

Now, take a look of the time of this post...
(EDIT: about 45 mins before this topic was created.)


..also, this is a cross post.


Why not have a serious agreement for people who register, that if they're not serious, they don't belong here. Very often that can even be seen from the first post a person makes. Some people come here to learn and really appreciate the help, some come here and behave like leeches. :(

Share this post


Link to post
Share on other sites
Because no one else seems to bite the bullet, I will...

Avont29, you cannot expect these forums to teach you C++. All the recent threads you've started here show that you don't master the language, in the slightest.

The best and only advice we can give you, is for you to buy a decent C++ book, and run through it. You seem to have the energy, in surplus even, so I'm quite sure it wouldnt take you much time to become proficient, and even if you don't have the money, there are many free ebooks and PDFs online.

What you're doing is a waste of yours and our energy. This is the same as banging your head against a door, trying to get it open, because you don't want to take the time to learn how to operate a knob...

Share this post


Link to post
Share on other sites
Quote:
Original post by Caminman
Seriously, this should be the last drop. Someone just complained that this guy was posting too much, so the reply of Mr. Avont29 was the following:

Avont29 Member since: 6/22/2005 From: Richmond, United States
Posted - 8/12/2005 11:42:11 AM
oh, ok, sorry about so many posts, i'll keep it down, and i'll fix my code on my own, i don't need your help, heh

Now, take a look of the time of this post... (also, this is a cross post).


Why not have a serious agreement for people who register, that if they're not serious, they don't belong here. Very often that can even be seen from the first post a person makes. Some people come here to learn and really appreciate the help, some come here and behave like leeches. :(


ok, im sorry, i'll keep the posts, down, im serious this time

Share this post


Link to post
Share on other sites
I don't know why I am even answering this...

The correct way to compare an array against a known value is to iterate through each one and perform a test. So in your example, you would have something like this.

for (int i = 0; i < numArrayItems; i++)
{
if (badWorlds == name)
{
// Do something
}
}

Share this post


Link to post
Share on other sites
Quote:
Original post by pinacolada
don't make me rate you down!

...


Me or the OP? [rolleyes]
Quote:
Original post by skittleo
I don't know why I am even answering this...

Because you're a nice person? [grin]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!