- 4,650
- 39
Is defining a structure template the same as defining a structure variable?
thanks.
thanks.
#include <stdio.h>
int main()
{
struct info //definition of the info structure template
{
int owner_account_num;
char owner_street_address[35];
char owner_city_state[35];
char owner_zip[6];
float owner_account_balance;
float owner_credit_limit;
// struct info * pointer_to_instance;
};
struct info typical_account = {
1001001001, "129 Maple Street","Tampa FL","90903", 7.345, 9.99
};
printf("%d, %s, %s, %s, %f, %f \n", typical_account.owner_account_num,
typical_account.owner_street_address, typical_account.owner_city_state,
typical_account.owner_zip,typical_account.owner_account_balance,
typical_account.owner_credit_limit);
// printf("Pointer value: ");
return 0;
}
typedef struct thingy_tag {
int someNumber;
char* aBigOlString;
void* secretDataNoPeeking;
double whoPutThisHere;
} thingy;
Yes, e.g.:Math Is Hard said:Thanks, plover. Can I initialize theThingy the same way I initialized the structure values?