C言語で構造体の動的確保

自分用のメモみたいなものです。

#include <stdio.h>
#include <stdlib.h>
typedef struct{
	int x;
	int y;
}STR;
void main(){
	STR *s;
	s = (STR*)malloc(sizeof(STR) * 10);// 10は確保したい1次元配列の数
	s[1].x = 15;
	s[9].y = 990;
	printf("%d,%d",s[1].x,s[9].y);
	getchar();
	free(s);
}