View Single Post
  #8   Spotlight this post!  
Unread 06-02-2007, 09:06
Metalgod4eva Metalgod4eva is offline
Registered User
None #0870
 
Join Date: Jan 2007
Location: Southold
Posts: 7
Metalgod4eva is an unknown quantity at this point
Re: Robot style EOF?

Quote:
Originally Posted by kitscuzz View Post
Kevin tends to use chars as another form of integers. Chars are, in fact, simply numbers, 8 bits in length that happen to be interpreted differently when sent to a terminal. There is not an "End Of File" command because you never send strings except to the camera, and then you really only send the characters and the line in terminated by a \r or \n, and wait for the camera to reply appropriately.

The processor interprets the data based on the information given to it by the code, aka if you pass a character, the processor waits for 8 bits of data, there is no need to indicate the "EOF" of a character because the processor knows that there is only 8 bits, no more, no less.

The "End Of File" command is actually an antiquated way of identifying the end of files in old DOS operating systems. The "EOF" command is no longer used except as a method of terminating input at a terminal (and even then, it's rare because the EOF command varies based on the operating system, not the hardware), and for saving files for VERY old systems. It is also occasionally used as indicating the end of a file when being sent over the internet (look into netcat 1.0).

The reason most systems don't use the EOF anymore is because they simply identify the size of the file at the start of the data, and then the computer doesn't need to read the whole file in order to allocate an appropriate amount of memory to display the file.
Actually EOF does not identify the size of the file or the start of data. EOF stands for End Of File/stream and job to signal like a semicolon in C statements, that the particular data stream is finished. EOF is represented as -1 or '\o'. As a native C programmer I have never heard anyone ever mention that EOF was no longer a macro in the standard lib anymore ^ have I seen it even not been. I understand that when working with robot on partial C code that does not conform to ANSI or hides most the code in many files that you just assume that if you don’t run across EOF does not mean its not there. EOF is a macro and is used for every line of stream. AKA after every \n a -1 is placed. Think of it as more of an End OF line. http://www.cprogramming.com/faq/cgi-...wer=1048865140
In response to kitscuzz:
Char are 1 byte and 3 byte padding:
"EOF" is not a character, its -1 an int:
Name an OS does not use EOF:
When passing a string to a cam: A string is an array, there is no string support in C. So all chars are saved in ordnance of the 0th element to MAX-1 element, The MAX element is '\0' || NULL in a char array and '-1’ in and int array. /*Lets for argument sake allow NULL == EOF even though there different in the char array the eof follows null*/ That is also the reason Even if you never declared the array all the function for strings must use them, thus all strings use EOF, all arrays use EOF. Brain W. Kernighan and Dennis M. Ritchie creators of c have an ANSI Book read pages 17, 28, chapter 7 151, 242+. Have a great day!