KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I was doing some C coding and after reading some C code I've noticed that there are code snippets like char *foo = (char *)malloc(sizeof(char) * someDynamicAmount); So I want to ask what's more C-ish way to allocate memory for char array? Use sizeof(char) and supposedly future-proof the code against any standard changes or omit it and use the number directly?
Tags (comma-separated)
Save Edits
Cancel