Maybe you should simply clear the screen before drawing in the main loop ?
Main Topics
Browse All TopicsHello
I hate ask long and odd questions but this problem make me really insane!!!!!!! please help me. I apologize you.
I coded a game in Linux and it works. (fireballs.cpp)
I decided to code it using shared memory and fork. (fork.cpp)
it works but Player class's Move function that should move player's shield, doesn't clear previously printed characters.
I hope help me
want to mention compilation command:
g++ fork.cpp -o fork.o -lpthread -lncurses -O2 (also for fireballs.cpp)
I apologize you again for my long and odd question. please help me
thank you very much
yours sincerely
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: eagerPosted on 2009-05-09 at 07:27:13ID: 24343939
Run your program under a debugger (gdb, for example) and step through the code which you expect to clear the characters.
It's a bit tricky to debug a program which forks, because the debugger will only follow the parent, not the child process. One way around this is to print the PID for the child and have it sleep for a while, which will allow you enough time to attach to the child process.