Hi, I have my structure. I would like to create a function where I use pointers.
I created one but It's not working as it's showing the memory but not the actual data...
There is nothing wrong with the syntax. Dereferening the pointer first, then making a dot reference to a member is perfectly fine.
However, what is bogus is that lines 23-29 do nothing. No values are assigned to the members. Since there is no constructor, the member values will be garbage.
But the values are assigned in another function which is ''create student''.
Since you didn't show us create_student, we had no idea it existed. That still doesn't change the fact that lines 23-29 do nothing.
Line 19: You're passing tabStudent as an argument, but make no reference to it. So if tabStudent has been initialized with values, you're not using those values.
Line 21: Stu1 is an uninitialized struct. As stated before, it contains garbage. You're going to print garbage at line 31.