Miscellaneous > Programming & Networking
Whats wrong with this program
(1/1)
Kintaro:
This program compiles, but there is somthing wrong with the printw bit.
--- Code: ---
--- End code ---
I guess i need somthing else instead of %d in the printw for strings and chars to be shown correctly (im used to cout in c++).
flap:
The format specifier for printing a string is %s, and char is %c. Although if you'd used %c your code would just print a character at a time, whereas presumably you want to print a word on each keypress?
In which case, your array of words should be more like:
--- Code: ---
--- End code ---
Then your loop would be:
--- Code: ---
--- End code ---
Kintaro:
No i want a char each keypress so it looks like you are typing them.
flap:
Just change %d to %c then.
Kintaro:
I did and thanks, it works...
http://users.bigpond.com/tate0/shit/swear.c
NOW THATS CURSES ;)
Navigation
[0] Message Index
Go to full version