![]() |
How to make my own porgram language
The problem is , how to write interface to a program
For example , I want to work with a set of points (they have coordinats) , the thing is how concrete can I realize commands . I compile program , then I start it , write adress of file with points and then write add (4;6) , and this comand should add point with coordinats (4;6) to the file wich adress I wrote |
Re: How to make my own porgram language
Your question is not clear. I don't think you want to write your own programming language. I think you probably want to use C/C++ to accept number pairs (coordinates) from the user and write them to a file.
You'll need to be clear which of those you want, however. |
Re: How to make my own porgram language
second, as you guessed
|
Re: How to make my own porgram language
Here's the deal, then.
Open a file for output. Set up a while loop. Inside the loop, ask the user to enter two numbers. Validate the input and, if correct, write them to the file. Exit the loop on some input condition, such as an empty line. Close the file. The particular functions you use for file I/O and for user input will depend on whether or not you are using C or C++. You don't say, and you don't give any indication of your level of expertise. I would strongly recommend you read this . |
Re: How to make my own porgram language
Oh, sorry , I m using C on unix platform , and I am working in Vim.Your advice is clear to me , I ll try to do so , but I want to use commands too. As I suppose , I need to make some functions for that like if to print word "add" and press enter , one of the functions ll be used. How to do that?
Thanks |
Re: How to make my own porgram language
I ll try to realize it and show it then
|
Re: How to make my own porgram language
so here it is
Code:
there are some mistakes(in a logic of a program) , I think , help me to find them |
| All times are GMT +5.5. The time now is 15:05. |