Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed last month.
Improve this question
One of my students asked why C would use * for pointers since it's already the multiplication operator. I didn't have a good response. I looked into some of the history, but couldn't find a "why". Hoping some of you might have been around a bit longer than me and know why * for pointer/dereferencing/indirection.
I understand this is not necessarily a coding-question per say, so some might get upset it is posted on Stack Overflow, but I know of no better place to ask this question.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I have tried to find it in google, but I couldn't.
I am studying C.
And now my stage is pointer and function about management memory.
But malloc, realloc, calloc...etc are hard to memorize.
So I want to know the full context. It will help to remember their meaning.
I do not speak English well. So my writing may be weird.
Please understand. Thanks for reading.
Memory Allocation (and reallocation etc...)
There is an awful lot to say about these functions but check out this article for a start.
And if you can still buy it read "The C Programming Language" by Brian Kernighan and Dennis Richie. A MUST Read
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Hello I am starting to learn programming and I would like to know this if someone could help me out.
If we know how many times will loop be done whats the easiest one to use?
You should use as a rule of thumb.
If know iterations --> for
If unknown iterations --> while
If at least one iteration (but not known) --> repeat
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am getting started to the embedded system's world. During this journey I came across to a "different" way to comment functions:
ISR(INT0_vect) { /* Run every time there is a change on button*/
I particularly prefer something like:
// Run every time there is a change on button
ISR(INT0_vect) {
Is it just a "taste thing" or by commenting like that I can "save" some EEPROM space in my ATMEGA168A?
The style of comments is purely an aesthetic concern. Compilers disregard all comments in your code when generating an object file, so how you format comments will have no bearing on EEPROM space.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm learning C. I wonder whether there is an instruction or command to recognize the type of the variable.
To be more practical: I have a program which works with integers, I want to show an error message if the user inserts a real number when running the program.
Hope you can help!
This is not part of the C standard, but GCC has the typeof keyword.
You have to be using the GCC compiler for it though.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'd love to create some part dynamically. Would it be possible to use offsetof with string as a second argument? Something like:
offsetof( tic, "close.v");
Or can I convert char to member anyhow?
The offsetof construct is a compile time operation. It can't be used with anything that is generated dynamically.