As you can see, both two solutions are certainly correct... But unfortunately, the code speed & performance, it's so terrible! And here's actually my function speed :
- Operators per second : Power operator : 1.500.000 operators per second
(It took about 14 seconds to complete...) Function : Below 200.000... D:
(It took about 69 seconds to complete...)
And about you, do you agree? How to fix and improve the function speed efficiently?
struct POINT
{
int x;
int y;
};
BOOL GetCursorPos(POINT &pt);
1 2 3 4 5 6 7 8 9
char *buffer = newchar[8];
void * void_pointer = buffer;
POINT *pt = (POINT*)void_pointer;
///////////////////////////////////
GetCursorPos(pt);
///////////////////////////////////
int *point = (int*)void_pointer;
printf("The X point : %d\n", point[0]); // POINT::x
printf("The Y point : %d\n", point[1]); // POINT::y
Interpreter (short, instantly) :
1 2 3 4 5 6 7 8 9
char buffer[8];
///////////////////////////////////
GetCursorPos(buffer);
///////////////////////////////////
int *point = buffer;
printf("The X point : %d\n", point[0]); // POINT::x
printf("The Y point : %d\n", point[1]); // POINT::y
EDIT : New multiple dimensional array concept has been found!!!
std::cout, std::wcout, std::cerr, std::wcerr, std::clog, std::wclog, std::cin, and std::wcin are global objects that are istreams and ostreams. http://en.cppreference.com/w/cpp/io
Scroll down to "Predefined standard stream objects:"
Jaskson Marie wrote:
What do you mean by that? ~~ - What does that mean?
It means you need to consider upgrading to an operating system such as DOS rather than just using vacuum tube computers. After DOS, you can move to Windows 3.1 when you feel comfortable. You'd still be about four to five versions behind the most recent technology, but it would be a step in the right direction.
@Jackson Marie, what is your native language? Clearly, you're not friends with English. Maybe we could use that information to somehow to improve our communication...
Agree with hamsterman (@Jackson Marie, what is your native language? Clearly, you're not friends with English. Maybe we could use that information to somehow to improve our communication... )
Yes. Weird. But secretly I won't say anything until the end of this project. :)
Edit :
EssGeEich : How to import and get function address of a Dll function?
Thanks and with thousands of functions, I consider maybe I'll need to upgrade the function library to level 3 to improve speed function browsing and achieve "the fastest function indirect access". :)
Edit : Also I'm going to make some additional functions which control manage the function library on demand. In my point of view it's so interesting because if this feature is added, because users can freely import, view and add their own functions... :D
SECOND EDIT :
Function type-cast is about to be upgraded to level 2, when a function item can carry a large amount of information. But if you specify a function with special parameters (e.g pointer), probably basic function type-cast will not be able to help you.
Oh not much, just about another 15 update posts about functions, and then we will hit level 4.
By the way Jackson Marie you never answered my question about the directX capabilities for you interpreter. You just seem to ignore questions that ask for specifics...
By the way Jackson Marie you never answered my question about the directX capabilities for you interpreter. You just seem to ignore questions that ask for specifics...
This is called "ultra-fast search method"
You only specify several necessary parameters, and immediately it will give the instant result!!!
(Instead of scanning the library million times)
As you can see, the parameter "first_character", "last_character" are regular char values. So the size of those arrays must be sizeof(char) = [256].
Simply for example :
"My_function"
(First character is "M" and last character is "n")
Checking :
1 2 3 4 5 6 7 8
//Valid item : "My_function"
//Basic conditions : ['M']['n']
my_function : The first character is invalid, so the request is aborted
My_functioN : The last character is invalid
Myfunction : All its basic conditions are allowed, but "Myfunction" is not found
My_function : Accepted!!!
So, is it much better than switch-case filter and linear-search with ultra-slow strcmp?? :)
Now the range is expanded, I want to add "number_of_parameters" suppose its size is 64 (may vary if needed).
So, accessing a function certainly is safer. Consider the example :
1 2 3 4
//Item strcmp (['s']['p'][2]) //Two parameters
strcmp(string_temp, "HA!"); //Valid
strcmp(string_temp, "HA!", 2); //Ignored - just because there isn't any "strcmp" function which has three parameters
About range :
Function level 0 : 8000 kb
Function level 1 : 2000 kb + switch case
Function level 2 : 256 x 256 = 65536 (cases) + simple filter
Function level 3 : 256 x 256 x 64 = 4194304 (cases) + ultra lighting speed !!!!!!!!!!!!!!!!!!!!!!
How do you feel about this idea? Do you understand it? Any opinion or suggestion guys? :)
valarray(104) : warning C4003: not enough actual parameters for macro 'min'
valarray(110) : warning C4003: not enough actual parameters for macro 'max'
valarray(104) : error C2059: syntax error : 'function-style cast'
valarray(167) : see reference to class template instantiation 'std::valarray<_Ty>' being compiled
valarray(104) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
valarray(167) : see reference to class template instantiation 'std::valarray<_Ty>' being compiled
valarray(109) : error C2143: syntax error : missing ')' before '}'
valarray(167) : see reference to class template instantiation 'std::valarray<_Ty>' being compiled
valarray(109) : error C2059: syntax error : ')'
.....????????????
Why this caused? And how to fix those compiling errors?
Many thanks. :)
2. Structure-Handmade Function
"Structure-Handmade Function" - unsupported features. So please use void* definition (temporarily) instead and if necessary, pick a proper pointer to access structure data.
(See the example at the previous page.)
3. Conditional expression IF_WHILE-FOR : Sorry, In progress :)
4. Special Libraries (std::cin - std::cout...) - Currently completely unsupported.
5. Format signs (/**/) (//) - in progress
How to test : Create a text file,
write your own code,
run the program,
pick a source file,
enjoy your program!
//Example :
1 2 3 4 5 6 7 8 9 10 11
char str[80];
int i;
printf("Enter your family name: ");
scanf("%s",str);
printf("Enter your age: ");
scanf("%d",&i);
printf("Mr. %s , %d years old.\n",str,i);
printf("Enter a hexadecimal number: ");
scanf("%x",&i);
printf("You have entered %#x (%d).\n",i,i);
Another examples :
1 2 3 4
char buffer[50];
int n, a=5, b=3;
n = sprintf(buffer, "%d plus %d is %d", a, b, a+b);
printf("[%s] is a string %d chars long\n",buffer,n);
1 2 3 4 5 6 7 8 9 10 11 12 13 14
void * pFile;
char name[100];
char strfile[256];
puts("Enter your output file : ");
gets(strfile);
pFile = fopen(strfile ,"w");
puts("Please, enter a name : ");
gets(name);
fprintf(pFile, "The name you have entered : [%s]\n",name);
fclose(pFile);
//See the main page for more details.
Do you want to test my program right now? If so, certainly I'll update & post my test program and any of your help would be greatly appreciated. If not, probably you'll need to wait at least one week, that's enough to complete "Conditional expression"... :)
Before including vararray you should #undefine min and max
Anyways I find it tedious to write a file to use an interpreter - sadly that's how most interpreters act like, but I prefer a realtime code interpreter.
Obviously in case of a while you should keep inputting lines, provided you are going to do it real-time.