Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 997 Bytes

File metadata and controls

37 lines (23 loc) · 997 Bytes

get_long_long(3)

NAME

get_long_long - prompts user for a line of text from stdin and returns the equivalent long long

SYNOPSIS

#include <cs50.h>

long long get_long_long(string prompt);

DESCRIPTION

Prompts user for a line of text from standard input and returns the equivalent long long; if text does not represent a long long in [LLONG_MIN, LLONG_MAX) or would cause underflow or overflow, user is prompted to retry.

RETURN VALUE

Returns the equivalent long long of the line read from stdin in [LLONG_MIN, LLONG_MAX). If line can’t be read, returns LLONG_MAX.

EXAMPLE

// attempt to read long long from stdin
long long ll = get_long_long("Enter long long: ");
// ensure long long was read
if (ll != LLONG_MAX)
{
    printf("You entered: %lld\n", ll);
}

SEE ALSO

get_char(3), get_double(3), get_float(3), get_int(3), get_string(3)