Untitled
public text v1 · immutable#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
struct foo {
char name[30];
int dongs;
} bar;
bar.name = "I lieks teh cock"; /* wrong */
memset(bar.name, 0, 30);
strncpy(bar.name, "I lieks teh cock!", 29); /* correct */
return 0;
}