Just to be different:
// an asm wait to mimic getch()
void wait()
{
asm mov dx,3DAh
l1:
asm in al,dx
asm and al,08h
asm jnz l1
Type: Posts; User: Ene Uran
Just to be different:
// an asm wait to mimic getch()
void wait()
{
asm mov dx,3DAh
l1:
asm in al,dx
asm and al,08h
asm jnz l1
I think it should be:
memset(string,'\0',strlen(string)-1);
Remember ctrl-z sends EOF (EndOfFile) in windows, and ctrl-d in Linux. I looked up the code on page 29 of my 1978 edition of K&R, you did quite a few modifications to make this thing work.
Glad you brought it up! I am the same way, just don't want to admit it!
Asking folks to ask a smart question is deductively stupid. Asking somebody to ask a thorough question is more like what you want.
You are absolutely hairsplitting right Kermit. In this case there will be most likely a newline in the string, unless your name is 500 characters long.
Both these functions are not totally safe. The return key causes the problem. Scanf() leaves a newline hanging in your input buffer. The hanging newline character is then possibly picked up by the...
fgets() also adds a newline to the end of your input string, something you might have to deal with.
// secure string input, fgets() replaces gets() and scanf()
#include <stdio.h> // BUFSIZ...
So what do you do about it?
Is test.bmp in a folder that has a space in it? Sometimes that creates problems with certain versions of Windows.