cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Lounge
Buffer!
Buffer!
Jun 8, 2011 at 4:04pm UTC
commander40
(9)
Hi,
What would be or is the best way to clear buffer for data entry?
Thanks
Jun 8, 2011 at 4:37pm UTC
chrisname
(7395)
This thread doesn't really belong here, it should go in the Beginners section (you can move it).
The normal way is to use a function like memset:
1
2
3
4
5
6
7
#include <string.h>
int
main() {
char
* buffer = malloc(2048); memset(buffer, 0, 2048); }
http://www.cplusplus.com/reference/clibrary/cstring/memset/
Topic archived. No new replies allowed.