Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Strange Problem

0 views
Skip to first unread message

Jason

unread,
Nov 14, 1999, 3:00:00 AM11/14/99
to
I'm having a strange problem with compiling my programs. I just
reinstalled Borland C++ 4.5 on my Windows 98 machine. I was trying to
use a particular program, and it kept giving me the error "Call to
undefined function 'cgets' in function main()." So I went to the online
help provided by Borland - copied the sample program for cgets and tried
to compile it - same message. I then went to some of my old
assignments, which I created under Borland C++ 4.5 (which I know to work
just fine), and started getting the same errors.

I checked the paths for my header files under
"Options\Project\Directory" and they are pointing to the correct place.
Last time I used this compiler I had Windows 95 installed. I have also
since installed Visual C++ 6.0. I've tried uninstalling and
reinstalling both of them, but nothing seems to work!!! Anyone have
anything similar happen to them??

I will post the code, although I don't think that it will help...like I
said, I've taken my own previously working programs and had the same
problem.

#include <stdio.h>
#include <conio.h>

int main(void)
{
char buffer[83];
char *p;

/* There's space for 80 characters plus the NULL terminator */
buffer[0] = 81;

printf("Input some chars:");
p = cgets(buffer);
printf("\ncgets read %d characters: \"%s\"\n", buffer[1], p);
printf("The returned pointer is %p, buffer[0] is at %p\n", p,
&buffer);

/* Leave room for 5 characters plus the NULL terminator */
buffer[0] = 6;

printf("Input some chars:");
p = cgets(buffer);
printf("\ncgets read %d characters: \"%s\"\n", buffer[1], p);
printf("The returned pointer is %p, buffer[0] is at %p\n", p,
&buffer);

return 0;
}

0 new messages