Hi all,

I'm new to C++ and am having a problem with a piece I am writing for an assignment. The problem area is below.

//arrival process on the corporate links
    if (clock % 4 == 0) 
double randomno
    randomno = randgen; // Generate random number
    if (randomno /100 <= p3) queue = queue + 3;

randgen will generate a random number, it has a variable double register random

Problem is with line randomno = randgen ........
The error is 104 .cpp cannot convert `double ()()' to `double' in assignment

Any help much appreciated!!

10 Years
Discussion Span
Last Post by spacecowboy123

you need to add the parentheses so that the compiler will know it is calling a function.

randomno = randgen(); // Generate random number

>>it has a variable double register random
do you mean you declared it like this ??:

register double  random;

All of the compilers I have used over the years only allow register keyword for integers (short, int and long). And today most compiler will ignore the register keyword altogether. There is no requirement for a compiler to honor that keyword.



Thanks Ancient Dragon, this solved the problem.

I didn't write the function I was calling, and it had double register random, which I thought might be important as I didnĀ“t know what it meant.

The function I am calling was written in C, if that makes a difference.

Thanks once again.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.