A
arnuld
I am unable to add anything to this struct> I can't understand why I am
getting a Segfault:
#include <stdio.h>
struct macd
{
int price;
};
void print_combo( struct macd* );
int main(void)
{
struct macd* my_combo = NULL;
my_combo->price = 100;
return 0;
}
void print_combo( struct macd* mc )
{
if( mc )
{
printf("Price = %d\n", mc->price);
}
}
getting a Segfault:
#include <stdio.h>
struct macd
{
int price;
};
void print_combo( struct macd* );
int main(void)
{
struct macd* my_combo = NULL;
my_combo->price = 100;
return 0;
}
void print_combo( struct macd* mc )
{
if( mc )
{
printf("Price = %d\n", mc->price);
}
}