#define STATIC_ALLOC 100
#include <stdio.h>
#include <string.h>
void main()
{
char StaticAlloc[STATIC_ALLOC];
memset(StaticAlloc, 0, STATIC_ALLOC);
strcpy(StaticAlloc, "Hello, World!");
printf("StaticAlloc == %s\n", StaticAlloc);
printf("END\n");
getchar();
}
using System;
using System.Runtime.InteropServices;
public static class Test
{
public const int STATIC_ALLOC = 100;
public static void Main()
{
char* StaticAlloc = stackalloc char[STATIC_ALLOC];
string _tmp = "Hello, World!";
Marshal.Copy(_tmp.ToCharArray(), 0, StaticAlloc, _tmp.Length);
}
}