You are here:

C++/C++ screen position

Advertisement


Question
QUESTION: hi, I'm using code blocks to write very basic programs for my son to get interested in C++...
Q1...all the down loaded source files compile with loads of errors...Why?
Q2...I'm trying to enter data at the same point on the screen but don't know the command

many thanks Martin

ANSWER: Hello Martin.

I assume you are using the Code::Blocks IDE. I don't have any experience with that and I don't know what the problem is with the source files you are trying to compile. Perhaps you have not set the include path correctly. That is usually the cause of compiler errors in otherwise correct code.

I don't understand your second question.

I don't know the age or aptitude of your son, but if he's an adolescent or younger, I suspect that C++ will quickly become quite dull. Have you considered some of the other more visual or physical examples of programming ? Generally they are more interesting.

Have a look at
alice.org
greenfoot.org
www.arduino.cc
and search for lego mindstorms.

The last option is probably the most expensive.

You can introduce your son to simple game making with visual basic or java as well. The nice thing about VB and java is that all the graphics are integrated into the system with large and powerful APIs.

Speaking from personal experience, if the child is not ready, don't push it.

Good luck.



---------- FOLLOW-UP ----------

QUESTION: Very any thanks for the quick reply..

I'm sorry but I was not very clear with the second question.

I hope this is a bit better.

hat I'm looking for is the equivalent of a Command like below

Print at (10,10) "code="

input code

Best regards Martin

Answer
Hello Martin.
What you are looking for is not a part of the C/C++ language or standard library. You need a Text User Interface (TUI) library for your operating system. Again, this is not an area where I have experience, but you can try PDCurses at http://pdcurses.sourceforge.net/
or ncurses at http://www.gnu.org/software/ncurses . Both are available for X11 (if you are using Linux) and Windows.

For background look at
http://en.wikipedia.org/wiki/Text_user_interface
and
http://en.wikipedia.org/wiki/Curses_%28programming_library%29

Best regards
Zlatko

P.S. I think the old turbo C++ came with a library for what you want. It is quite obsolete, but very popular in India it seems. One of the experts from India may be able to tell you how to get it.

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Zlatko

Expertise

No longer taking questions.

Experience

No longer taking questions.

Education/Credentials
No longer taking questions.

©2012 About.com, a part of The New York Times Company. All rights reserved.