Library Problem - [I Think]

This is a discussion on Library Problem - [I Think] within the C Programming forums, part of the General Programming Boards category; I keep on getting the same error. I'm using VSC++6.0 to run it. Says randomize, clrscr, random are all undeclared ...

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    1

    Library Problem - [I Think]

    I keep on getting the same error. I'm using VSC++6.0 to run it. Says randomize, clrscr, random are all undeclared identifiers

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Yeah, that's because they're not in MSVC++. 'randomize' if I recall correctly is a Borland function. Furthermore, 'clrscr' and 'random' are also. Either that, or you simply aren't including the correct header. However, if I remember correctly, those are Borland functions.

    #include <time.h>
    #include <stdio.h>

    void randomize( void ) { srand( time(0) ); }

    There. Now you have a 'randomize' function. As for 'random', use 'rand'.

    x = rand() % 10; //produce a number from 0 to 9.

    Don't even ask about clearing the screen. Read the FAQ. This is the problem with using non-ansi functions.

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. undefined Reference when linking a library
    By steve1_rm in forum C Programming
    Replies: 7
    Last Post: 03-12-2008, 06:34 PM
  2. Templates from DLL or static library problem
    By mikahell in forum C++ Programming
    Replies: 2
    Last Post: 01-01-2008, 01:49 AM
  3. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  4. Bin packing problem....
    By 81N4RY_DR460N in forum C++ Programming
    Replies: 0
    Last Post: 08-01-2005, 06:20 AM
  5. Problem With WinPcap library
    By DrMario in forum C Programming
    Replies: 0
    Last Post: 03-26-2005, 11:26 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21