Top "Memset" questions

memset is a C standard library function that sets the first N bytes of the block of memory to the specified value (interpreted as an unsigned char)

how to set pointer to a memory to NULL using memset?

I have a structure typedef struct my_s { int x; ... } my_T; my_t * p_my_t; I want to …

c++ null pointers memset
error: ‘memset’ was not declared in this scope

I am trying to compile the complete example 8 provided at the end of this page: http://www.physics.wisc.edu/~…

c++ compilation memset
Using memset to set an array

I am a newbie to C still, and I am having a problem with the memset function. I pass a …

c arrays memset
Calling memset causes segmentation fault

This program causes a seg fault on my UNIX machine. I narrowed the cause down to the second call of …

c unix struct segmentation-fault memset
C++ equivalent for memset on char*

I have this code char * oldname = new char[strlen(name) + 1]; memcpy(oldname,name,strlen(name) + 1); name = new char[strlen(oldname) + …

c++ memcpy memset
how can we initialize a vector with all values 0 in C++

In an array we can do int arr[100]={0} ,this initializes all the values in the array to 0. I was trying …

c++ vector stl initialization memset
implicit conversion changes signedness 'int" to 'unsigned int"

I was using clang++ to compile the program and I need to compile it with no error in clang++. I …

c++ implicit-conversion memset
What is the Linux kernel equivalent to the memset function?

I'm writing a driver that requires me to clear all the memory allocated to zero. memset is a userspace function, …

c linux-kernel kernel driver memset
How to memset() memory to a certain pattern instead of a single byte?

I need to write a repeating pattern to memory (e.g. 0x11223344), so that the whole memory looks like (in …

c memory design-patterns memset
Complexity of the memset function in C

I was discussing with some friends a piece of code, and we discussed about using memset function in C, which …

c complexity-theory big-o memset