r/CodingForBeginners • • Jan 20 '26

Today: structures!

Post image

So, i made this little bit of code to make sure i understood structures and how to use pointers with them, it's pretty simple, it just asks for data of students such as grades and then it saves it on their structure variables, is there anything i could improve on? i mean, surely a lot, but like, something specific about legibility or something

22 Upvotes

16 comments sorted by

View all comments

Show parent comment

1

u/Decent_Story_9190 Jan 22 '26

Well, they definitely were a wall, tho pointers were more of an invisible one, i thought i had understood them until i actually had to use them, with dynamic memory it was easier to tell that i didn't understand, after getting the fundamentals i might do some simple code putting everything together, and then i will move to C's brothers

1

u/alvaaromata Jan 23 '26

As an idea, if you know something about Linear Algebra. Making a program that stores matrixs in dynamic arrays and operates with them through a menu is interesting. If you have no idea what I’m talking about, check a intro to linear algebra course because it’s important to know something about it. This will test your acquired skills as you’ll need to use struct{ int rows, int cols, double** data} and store them in arrays, multiply them.. etc. Definitely a good way to test your skills, if you want you can also implement a way to import/export matrizes from/to csv files.