source: CIVL/examples/opencl/2.15/simplemallocs.cvl@ bb03188

main test-branch
Last change on this file since bb03188 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 378 bytes
Line 
1#include "cl.cvl"
2#include <stdio.h>
3#include <stdlib.h>
4#include <string.h>
5#include <civlc.h>
6
7int main(int argc, char** argv)
8{
9 void * array[3];
10
11 int star = 1;
12
13 for (int i = 0; i < 3; i++)
14 {
15 array[i] = (int*)malloc(sizeof(int));
16 memcpy(array[i], &star, sizeof(int));
17
18 }
19
20 for (int i = 0; i < 3; i++)
21 {
22 free(array[i]);
23
24 }
25
26 return 0;
27}
Note: See TracBrowser for help on using the repository browser.