170k views
4 votes
How do i write this in c++ = scnr.nextInt();
please help

User Paveldroo
by
7.1k points

1 Answer

4 votes
int whatever = scnr.nextInt();



Although usually when a class has a next* member function, it usually needs to check that there IS a next, that you haven't reached the end. Without knowing the class that scnr was instantiated from, I can't guess.
User IsaacLevon
by
9.1k points