Answer Posted / szeke
As i know pointers are only simple memory adresses stored in variables. There are many situation they can be used, not only passing parameters. APIs from C, dynamically allocated variables, structures.
A %TRIMR can be a pointer in the original field instead of building another instance of it. Working with orbital buffers, parsing them, break into separated fields, from another ILE language or module can be received and send by a number of pointers instead of copy the value.
Doing anything with a pointer value doesn't point to the correct location is a pointer error. All the data types represent pointers anyway, but they maintained by the compiler, not by the programmer. To forget freeing unused pointed memory areas is another type of error. The use of pointers can cause such errors like invalid data, or memory leaks, since the compiler has no idea what we store on that variable, it must believe we're right. In java, the compiler strictly checks an array out of bound pointer operation, in C++ i have the right to browse the whole memory from a simple a[2] defined array by adressing it as a[12345]. Also no expensive type checkings, so the performance is better.
I can erase a value, or don't even initialize it in the memory but the pointer will still exist and pointing into a non-defined value.
The instruction pointer is also a pointer, can be manipulated by GOTO jumps, or Subs, OOP programming languages are just abstract definitions over the same thing, basically every procedure will be called by its pointer in the memory, determined by compiler or the user, in compile time or run-time... It is called procedure pointer. To point into a variable instead of a PROC is another serious error...
So, what is the question exactly?
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Which command is used to replace CDUP command in FTP IF i WANT TO USE SFTP?
what is overlay?
To Add A File To The 'file Selection' Option Of A Query, The Function Key To Be Pressed Is?
different type of cursor?
when should I use method get, and when should I use method post in my cgis?
is it possible, in the same cgi, to run more than one gethtml or gethtmlifs?
the output from my cgi is correctly interpreted by ms internet explorer, whereas netscape navigator would display it as a plain text. What should I do to have also netscape interpreting the html output from my cgi?
What is the difference between iter and do? We know both are used to execute set of statements repeatedly, but what is the main difference?
what is the purpose of overrides?
What is compiler directive in as400? Give example of compiler directive.?
what is meant by object lock requests,held locks and locks waiting to be applied(wrkobjlck) why should we apply for locks.Please explain sir.
what are the limitations of cl (compare to rpg) ?
what are the different opcodes available in rpg for database access ?
what is the difference between packed decimal and zoned decimal?
what are the different types of arrays available in rpg ?