|
-
January 29th, 2012, 05:40 PM
#1
New to C++, declaring a string issue
Hey hows it going guys. I am just learning c++ now because I have started a new job that works with computers so i figured itd be useful to learn. it is my first programming language and im excited.
Anyways, my issue is: I am trying to make my first form application, which includes just hardcoding my passwords for different usernames/accounts so when I enter a universal password, I can click the one I have forgotten, and it will display it.
I have created my forms but for some reason when I try to declare my string, I keep getting an error that says "There is no = binary operator that takes the right side of a string etc. blah blah"
My code right now is
string userpassword;
userpassword = txtPassword->Text;
Where userpassword is my string, and I want it to equal the text that is in my txtPassword (textbox).
What i did at first was something like,
if (userpassword = "beans") {open this new form blah blah}, but I got the same error message.
What is the proper way to write this piece of code? and can you explain to me why this is wrong?
Thank you very much. My dad helps me a lot with this but he only knows C# so he is confused by most of this stuff
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|