Skip to content

Instantly share code, notes, and snippets.

@mlabbe
Last active June 22, 2017 00:13
Show Gist options
  • Select an option

  • Save mlabbe/75b28ec8f30f8bbb141e44ef7858ecc0 to your computer and use it in GitHub Desktop.

Select an option

Save mlabbe/75b28ec8f30f8bbb141e44ef7858ecc0 to your computer and use it in GitHub Desktop.
struct string
#include <stdio.h>
typedef struct {
char s[6];
int len;
}str_t;
int main(void)
{
str_t str = {"hello", 6};
printf("%s\n", (char*)&str);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment