View Single Post
Old 10-09-2004, 01:49 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,736
redhead is on a distinguished road
Isn't this supposed to be ^D (ctrl+d)? which means EOF, as I understand (ctrl+z) will suspend any program (atleast on *nix it does), There's no abitrary char value for it as far as I remember.
(ctrl+s) will pause any output from a console, atleast on *nix it does, and then you can use (ctrl+q) to reactivate it.
But (ctrl+z) I've never heard of it apart from the "Undo" command in some windows progs.
If he wanted to find out, he could make a small program to test it ie:
Code:
#include <stdio.h>
#define BUFFER_SIZE 10
int main(){
  while(!feof(stdin))
  {
    char buffer[BUFFER_SIZE+1];
    int n;
    if(!fgets(buffer, BUFFER_SIZE, stdin))
      break;
    for(n=0; buffer[n] != '\0' && buffer[n] != '\n'; n++)
      printf("Int value: %d\n", (int) buffer[n]);
  }
  return 0;
}
Warning code hasn't been tested.
Just to print, what integer value it might give..
Then he could use that integer in the comparison when dealing with (ctrl+z).
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote