Author Topic: C# help  (Read 1109 times)

Recently I bought a book on c# and have been learning some stuff. But then I ran into two problems help :(   (this is the first problem)


Code: [Select]
// this is in my class
        private string exampleAddress = "joe@example.com";          // apparently its value is never used
        public bool VerifyEmailAddress(string exampleAddress)         // I believe I'm declaring the string exampleAddress here again but I'm not sure
       {
           

           return true;
       }

// this is in my  program

Console.WriteLine(c.VerifyEmailAddress("joe@example.com"));
Console.WriteLine(c.VerifyEmailAddress("jim@example.com"));          // this is suppose to return false







turds

Dont understand this at all

Stop using C# and buy a C++ book.


dude c++ isn't the right langauge for me to use right now.

dude c++ isn't the right langauge for me to use right now.

Why?

Then what the forget are you doing with a programming language just about as complex?

C# is what I'm learning and c++ isn't what I want to learn, should learn, or am learning. How about instead of cussing at me, you be decent?

Alright. Sorry for being a richard.

Uh, I don't really know C# but what you're doing doesn't look like it'd work at all

You should do something like this:

Code: [Select]
public bool VerifyEmailAddress(string exampleAddress)
{
if(exampleAddress == "joe@example.com")
return true;
else
return false;
}

Use a conditional to test the email address.

Theres more code behind it ._.

...why don't you show us the rest of the code then? We can't help you otherwise

...why don't you show us the rest of the code then? We can't help you otherwise

Yes we can. What he provided is enough to find out what's wrong.
His problem was that he wasn't checking the variable's value.

Stop using C# and buy a C++ book.
dude c++ isn't the right langauge for me to use right now.
Use mine.
Warning - while you were typing 7 new replies have been posted. You may wish to review your post.
Epic fail