Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
sxg said:the first one shows the 'buffer' is a constsant, it point to a element of char type
the sencond one shows both the 'buffer' and the context whit char property it pointing to are constant.
You can't have that. It's a syntax error. Maybe you meant this:sunroof said:So, if I have:
buffer = char packet[8];
Yes, for that assignment, I did it wrong.echo47 said:Suggestions:
1. Enable all of your compiler's warning and error messages. They frequently catch typos and suspicious code.
2. Search for a small command-line utility called "cdecl". It will translate C declarations into semi-english. For example:
cdecl explain const char * const buffer
Declare buffer as const pointer to const char.
cdecl explain const char * const * buffer
Declare buffer as pointer to const pointer to const char.
You can't have that. It's a syntax error. Maybe you meant this:sunroof said:So, if I have:
buffer = char packet[8];
char packet[8];
buffer = packet;
If that's true, then:
1. error: assignment of read-only variable `buffer'
2. warning: assignment from incompatible pointer type