Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

C++ Functions output error

0 votes
asked Apr 20, 2018 by anonymous

I am trying to make a program to play a card game. The goal is to make this by only using functions, and the *main()* function will remain empty other than calling the other functions. I have done this previously without the use of user-defined functions, and it worked flawlessly. I am getting weird outputs this time, any help would be greatly appreciated.

https://www.onlinegdb.com/fork/HyPbh_Dhz

1 Answer

0 votes
answered Apr 21, 2018 by king of war
.cpp: In function ‘void drawCards(short unsigned int&, char&, short unsigned int&, char&)’:
1.cpp:85:19: error: ‘srand’ was not declared in this scope
    srand(sequence1);
                   ^
1.cpp:86:29: error: ‘rand’ was not declared in this scope
    randomnumber1 = 3 + rand() % 4;
                             ^
1.cpp: In function ‘bool continueBattle()’:
1.cpp:272:9: error: ‘exit’ was not declared in this scope
   exit(0);
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...