Comments (4)
I have added C99 standard and description what is flexible array
. It's a popular thing used pretty often in any kernel code for Windows and Linux.
Thanks for reference, such as:
https://wiki.sei.cmu.edu/confluence/display/c/DCL38-C.+Use+the+correct+syntax+when+declaring+a+flexible+array+member
But I try to use standards, when it's enough.
Support of varying array array.
- is a misprint..
from cpp_from_1998_to_2020.
Ok, now it is more clear, however still I do not understand what is purpose of the [*]
. MSVC does not support it. GCC does support but in the function prototype only. What is the difference between these below:
void foo(int arr[], size_t arrSize);
void bar(int arr[*], size_t arrSize);
from cpp_from_1998_to_2020.
If the size is not present, the array type is an incomplete type. If the size is * instead of
being an expression, the array type is a variable length array type of unspecified size,
which can only be used in declarations with function prototype scope;122) such arrays are
nonetheless complete types.
Now the question is what is incomplete type
BTW, variable length array is also array of size that is not const value:
int z = 5;
int arr[z]; // << variable length array
from cpp_from_1998_to_2020.
> void foo(int arr[], size_t arrSize);
> void bar(int arr[*], size_t arrSize);
> ```
- I have added incompleted type information into the glossary
- I have updated the variable-length array description
- I have removed a variable-length array that is confusing [*] notation.
> What is the difference between these below?
I don't know. I thought construction with `[*]` allows to have an incomplete type, but it's not the case.
(In experiments with `gcc -x c --std=c99` through https://godbolt.org/). For me both foo and bar is identical and nothing special I see inside https://godbolt.org/.
from cpp_from_1998_to_2020.
Related Issues (11)
- Each value is implicitly converted to an RValue. HOT 1
- C++ is the fastest general-purpose programming language in the world HOT 3
- [Benchmark] 4. C/C++ benchmark code is not fair HOT 4
- "The Compiler and Linker. Details." format HOT 3
- Non-actual information regardng RValue life extension HOT 3
- Extra parentheses inside the decltype expression HOT 2
- PDF file generator does not support formula HOT 3
- In C and C++, the components of the variable of structure type struct has addressed HOT 4
- Please avoid use of "C/C++"; C and C++ are distinct languages HOT 6
- Consider licensing the notes. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpp_from_1998_to_2020.