[cc65] Function prototyping - different in CC65?

Date view Thread view Subject view

From: Greg Long (greg_at_maneuveringspeed.com)
Date: 2003-03-04 20:24:44

Looking at some online C tutorials, function prototypes seem pretty much
like C++, so I have to ask the question:  What am I doing here that CC65
does not like?

C:\Program Files\vice\sort.c>cl65 -v ShellSort.c
ShellSort.c(13): Error: Conflicting types for `rand'
Line: int main()
ShellSort.c(35): Error: Conflicting types for `rand'
Line:  unsigned int a=10;


#include <stdlib.h>
#include <time.h>
#include <conio.h>

//function declaration, line 13 follows this line
unsigned int rand();

//unsigned long r_seed = clock();

int main()
	unsigned int size = 10000;
	unsigned int i = size;
	unsigned int* ra;
	ra = (unsigned int*) malloc(size*2);

	//generate random numbers
		ra[i] = rand();
	return 0;

unsigned int rand()
	//this code to be replaced with a random number
	//generating algorithm
	unsigned int a=10;

	return a;

To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.

Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-03-04 20:26:23 CET