Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- typedef struct Foo_t {
- int a;
- char * s;
- } Foo;
- void my_func (Foo foo) {
- fprintf (stdout, "a: %i, s: %s\n", foo.a, foo.s);
- }
- void my_func2 (Foo * foo) {
- fprintf (stdout, "a: %i, s: %s\n", foo->a, foo->s);
- }
- int main (char * argv, size_t argc) {
- // This does work
- my_func ((Foo) {10, "World!"});
- // This does not work.
- my_func2 ((Foo *) {5, "Hello!"});
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement