It is very common to declare and pass a basic data-type variable during a function invocation, can we achieve something similar with the structures ? Below code explains my question better.
struct s
{
int i;
char c;
};
void f(int i)
{
return;
}
void g(struct s s1)
{
return;
}
int main()
{
int i = 5; // possible
struct s s1 = {1, 'c'}; // possible
f(i); // possible
g(s1); // possible
f(5); // possible
g({1, 'c'}); // not possible, is there any alternative way ?
return 0;
}