# std::basic_streambuf<CharT,Traits>::snextc

> C++ Atlas: `cppatlas.com/w/cpp/io/basic_streambuf/snextc` | Source: https://en.cppreference.com/w/cpp/io/basic_streambuf/snextc | Domain: Input/output | Standards: C++17

Advances the input sequence by one character and reads one character.

## Official Specification Summary (cppreference)

```cpp
int_type snextc();
```

Advances the input sequence by one character and reads one character.

The function calls `sbumpc()` to advance the input sequence. If that function returns `Traits::eof()` meaning that input sequence has been exhausted and `uflow()` could not retrieve more data, `Traits::eof()` is returned. Otherwise `sgetc()` is called in order to read the character.

### Parameters

(none)

### Return value

The value of the next character. If the input sequence has been exhausted, `Traits::eof()` is returned.

### Example

> Note: This section is incomplete Reason: no example

### See also

- [`sgetc`](https://en.cppreference.com/w/cpp/io/basic_streambuf/sgetc): reads one character from the input sequence without advancing the sequence (public member function)
- [`sbumpc`](https://en.cppreference.com/w/cpp/io/basic_streambuf/sbumpc), [`stossc`](https://en.cppreference.com/w/cpp/io/basic_streambuf/sbumpc) (removed in C++17): reads one character from the input sequence and advances the sequence (public member function)

---
Attribution: content from https://en.cppreference.com/w/cpp/io/basic_streambuf/snextc (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.