memset



Defined in string.h

void *memset( void *s, int c, size_t n);

The memset() function initializes the n bytes of the memory area pointed by s with to the str argument.

Parameters

s : pointer to the block of memory to fill.

c : the value to set .

n : number of bytes to set.


#include <stdio.h>
#include <string.h>

int main ( int argc, char* argv[]) 
{
	char s[50];
	memset( s, 0, sizeof(s));

	return EXIT_SUCCESS;
}


The above program, set the block of memory to 0 by using memset.


#include <stdio.h>
#include <string.h>

typedef struct myData
{
	char str[50];
	int i;
} MyData;

int main ( int argc, char* argv[]) 
{
	MyData mMyData;
	memset( &mMyData, 0, sizeof(MyData));

	return EXIT_SUCCESS;
}


The above program, initializes the struct with memset.



strtok

Split string into tokens

posted on 2019-03-17 20:41:48 - C Programming Language Tutorials


zalloc

zalloc is a third party library

posted on 2018-12-12 20:46:30 - C Programming Language Tutorials


math

posted on 2017-12-29 22:52:47 - C Programming Language Tutorials


Prompt Examples

ChatGPT Prompt Examples

posted on 2023-06-21 22:37:19 - ChatGPT Tutorials


Use Cases

Chat GPT Key Use Cases

posted on 2023-06-21 21:03:17 - ChatGPT Tutorials


Prompt Frameworks

Prompt Frameworks

posted on 2023-06-21 19:33:06 - ChatGPT Tutorials