Hi All,
I want to take input from a console application. Is there any function like scanf available in symbian c++? or any other methods to get the input from the user in a variable.
Any help would be great.
Regards
Sumeet Kumart
Hi All,
I want to take input from a console application. Is there any function like scanf available in symbian c++? or any other methods to get the input from the user in a variable.
Any help would be great.
Regards
Sumeet Kumart
Why shold not you open SDK and check API CConsoleBase ?? Anyway CConsoleBase does not have any method like Scanf(), check CConsoleBase::Getch(), if its helpful in anyway.
When in doubt, search :-)
Here is one from the wiki
http://wiki.forum.nokia.com/index.ph...e_applications
Cheers,
Mayank
Thanks for your reply Mayank.
But I am not able to make this code run on the emulator. My requirement is, that i want user to enter his/her phone number on the console and then save this phone number in a text file. I am able to save a hard coded number in the text file but have no success in taking input from user and then saving it.
Can you please suggest something
Thanks once again
Well what is the issue/error you are facing with that link, did you maintain a class level buffer of some kind where u keep appending the key presses so that it can be saved to the file at a later point in time?
Cheers,
Mayank
Why? What happens? Note that the Wiki example relies on a running Active Scheduler. Have you instantiated, installed and started such thing in your code?
Thanks for the reply.
Actually, i m new to the symbian c++ developmentso thats why i just copy pasted the code given in that link and tried to run it in my application but i not even able to see the console.
Last edited by sumeet_netsmartz; 2009-06-12 at 09:08. Reason: Typos
Create a blank console exe using New->Project->Symbian OS C++ Project->Basic Console Application, and first try to understand the workings of that plain example.
Also enable the panic codes by http://wiki.forum.nokia.com/index.ph...ded_panic_code
You would also do well to go through some basic beginner's stuff
http://wiki.forum.nokia.com/index.ph..._Symbian_OS%3F
Once you are comfortable with it then try selectively copy/pasting the code from that link shared earlier. Try debugging the code to see what is going wrong where for a better understanding.
Cheers,
Mayank