but , when im running ur code its a bit missunderstood.
i want that the user will press the charecters and not letters (such C instead of 2).
if the user will press C he will have option to make an account, and if press L he can enter an existing account . with password and all of this.
when he type a password he will chack if the letters are the same if thay r he will continue.
can i speak with u in the private ?
send me msg plz!
snoopy the tiger wrote:
>umm the codr you have written dont work
>i put iostream etc....
>you have any idea how do i write my project code?
The code works perfectly fine, It's the person who is implementing it that has the problem. Ask me a specific question. I know how to do your assignment, but I'm not going to do it for you unless you pay me or something. So if you would like to attempt it then ask a question and I will try to help you understand.
Snoopy, the code won't work for you because I simply posted an example for it to work you would need the 'input' to be the variable char you are reading in. and the functions makeAccount(); enterAccount() would need to be implemented in your code.
Here's your code compiled and working, however it's a piece of crap no offense, you really need to start back at the beginning and work on basics. Please don't PM me anymore any questions can be posted so everybody can have a chance at answering them.
To start at the begining i suggest making "Hello World" app, then move on to some math functions if you can do math, then move on to strings and string manipulation and by that I mean make use of substring, strcpy and stuff, and then move onto OOP principles, and then arrays, then file reading/writing & exception handling, by this stage you should know how to proceed so you don't need me to instruct you.
Nobody is going to hold your hand through this, you need to learn how to teach yourself programming using the resources available (text books and this website documentation) teachers rarely teach anything, at best they say "do this work" then it is up to you to learn the work and do it.
I suppose, it does nothing useful. It won't even enter the switch, will it? IIRC cin won't convert the number given (which is a character); into an actual number, so you'll have to minus '0' from the answer. The quotes are important.
@snoopy the tiger
I will add, and it will sound harsh, that programming isn't for everyone. Maybe it isn't for you...
choice is an int so it will enter the switch, but the switch does nothing but store some variables then exit the program. It doesn't compare name/password with something stored on anything like an encrypted file.
personally I think he is just getting ahead of himself, there's no way he could create search_engine.cpp at this current level. Needs to go back to basics, while programming isn't for everyone I think it depends how badly you want it as well. It took me twice as long as anyone in my class to pickup yet I persisted and persisted because I knew it was what I wanted to do.
I still find some concepts are hard to grasp unless I fully research them. But I do and it works.
I thought cin didn't do any type-checking? Also, ints can store [tt]char[tt]s; because a char is an int. They're just a single byte wide (unless you use a wide char, but I don't know what the difference is). In C they used to use ints for storing the result of getchar() (getchar() returns int) and such. I think char was only used for arrays (i.e. C strings).
IIRC cin won't convert the number given (which is a character); into an actual number, so you'll have to minus '0' from the answer.
I thought cin didn't do any type-checking?
operator>>() has an overload (among other overloads) for int: std::istream &operator>>(std::istream &,int &);
It reads characters from the stream until it finds a non-whitespace, then it reads some more until it finds a non-digit. If no digits were read, it returns something (I'm not sure what, but calling operator!() on it returns true); otherwise it takes these digits and converts them to an int, which is assigned to the second parameter.