C++ Programming Error [duplicate]

Another homework question? Seems to be the season for them. Here’s a point in the right direction: getTwoRandomNumbers takes some parameters. Look at the function declaration, it’s asking for something. Other than that, listen to the first comment on your main question. I highly suggest doing some basic reading on C++.

Update: People seem to not like this question, though it isn’t such a bad one. Your first issue to address is that you’re returning the name of the function, not the variable you’re storing the random number in. I can’t laugh at this mistake, I’ve made similar ones myself (and still do on occasion).

Once you’ve done that, your getTwoRandomNumbers function has some values in needs passed to it to function. You have it spelled out in your function declaration there. Reading a few chapters in an into c++ book would do you a lot more overall good then asking people here for help on what you’re doing wrong. I get the impression you don’t have a full understanding of the concepts behind c++.

Update 2: Annnnnnd one last thing. Always remember, when you want to use a variable, you have to declare it first. All of them, not just most of them.

Leave a Comment