For home work i have to do SMS in c++ ,which has to be exactly like on mobile.I dont know how to do this.

Recommended Answers

All 3 Replies

What hardware are you supposed to use?

I must wrote just a program like on mobile keybord. When you press 1 will be on the screen a, when you press another time 1 you will get on screen b, etc.

You will have to do some console handling for that. At first glance the procedure will be something like below.

Press a key
  Look what the key is
  If another key is pressed within the given time limit
        If it was the same as the previous one
                  Erase first character and update buffer with the next one
        else 
                   Update buffer with the pressed key 
    Else
         Update the buffer with the pressed key

There is no portable way of getting it done, unless you do some serious console scrolling. So you may have to use either a 3rd party library or the API of the operating system you are using.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.