Could help about making that code pure C.
struct edge
{
char key;
char values[5];
};
edge* a = new edge[9];
Could help about making that code pure C.
struct edge
{
char key;
char values[5];
};
edge* a = new edge[9];
typedef struct
{
char key;
char values[5];
} edge ;
edge *a = malloc(9 * sizeof(edge)) ;
This should do it
I'm going to take a shot in the dark, and assume that you actually don't need dynamic memory allocation at all. In that case, the C version is:
struct edge
{
char key;
char values[5];
};
struct edge a[9];
Remember, in C++ you don't need new
to create objects, you only need new
if you want to dynamically create objects.
If my guess is correct, the above will work perfectly for you. If my guess is incorrect, then you'll get an error in your program on a line like:
a = foo;