I am using a book to learn C++. Unfortunately the book, sometimes, uses the maddening phrase, #include <conio.h>, which is a M$ related file and not a part of STL, in some of its examples.
My question is: How would you modify the following code so it would compile and run on Linux? Here is the code:
The code is primitive, I know, as I got it from the first couple of chapters of this book.
Thank you so much in advance,
eager
PS.
I am also open to any suggestions for more books, although I find the current one very useful, except this conio.h file!
Wow, I haven't seen conio.h since my Turbo C for DOS days. I doubt you really want to go to all the trouble of using ncurses... you can't just include it and start throwing around getch-es, you have to set up a window and mode and all that stuff. Unless interactivity is really that important to the code(it almost never is), just use stdio i/o and expect things to be buffered by lines.
Yes, like I said, there is no easy way to adjust it for linux because it's using DOS-specific features. Like I said, if you really wanted to, you could use ncurses, but that's a lot more complicated than just including a header and using its functions instead. So, like I said, using normal stdio i/o and expecting it to be line buffered would work.
I've been diving into awk but still learning how to use it for text formatting. Below you can see my results are separated by a comma. Can somebody show me how to separate by TAB as well? An explanation would be appreciated as I did not comprehend the answer in the man pages and would like to gain... (1 Reply)
Hi i m running a command
watch -n 1 -d netstat -i to see the packet drops every 1 second.
but the problem is the output is so long(Due to large number of virtual interfaces) it doesn't fit into the putty prompt.
I dont need to monitor each and every network interface I m more interested in... (5 Replies)
What is the easiest way to find the date 6 month prior to the current date.
Example:
Today is 2011/01/29
I need to find the 1st day of the month, 6 month ago, which is 2010/08/01. I have to count 1/1/2011 as a previous month, since the current day is past 1/1/2011. Is there any easy... (4 Replies)
I am new to this so i figure this is an easy one.. How do i change the time zone from Central to Eastern time in SunOS 5.8 ? I thought I needed to edit the /etc/TIMEZONE and them issue TZ=US/Eastern but I want to check. Is a reboot required afterwards?
If I want to change the system time... (3 Replies)
QUERY SCENARIO
Here is the actual scenario
LOOP
echo "$COLNAME $TYPENAME($LENGTH) $NULLS ">>$DDL_FILE
END-LOOP
COLNAME, TYPENAME, LENGTH, NULLS are the variables and within echo statment the output of which has to go into file specified by DDL_FILE.
... (1 Reply)