gcc Variable-length_array
2011-10-24 17:13
120 查看
http://en.wikipedia.org/wiki/Variable-length_array
意味着gcc下,这么写是可以的:
#include <stdio.h>
int main() {
int buff_size = 1234;
char char_buff[buff_size];
printf("size:%d", sizeof(char_buff));
return 0;
}
VS2008下是不行的,
仍需要: const int buff_size = 1234; 以示说明.
意味着gcc下,这么写是可以的:
#include <stdio.h>
int main() {
int buff_size = 1234;
char char_buff[buff_size];
printf("size:%d", sizeof(char_buff));
return 0;
}
VS2008下是不行的,
仍需要: const int buff_size = 1234; 以示说明.
相关文章推荐
- Box2D: 错误variable length array of non-POD element type 'b2Vec2'
- expand gcc case variable length
- Box2D: 错误variable length array of non-POD element type 'b2Vec2'
- ANSI C, Variable Length Array, Dynamic Memory Allocation, Memory Reservation and Late Binding
- 0-3为变长序列建模modeling variable length sequences
- Android-71-解决报错: java.lang.ArrayIndexOutOfBoundsException: length=2; index=2
- Array.length vs Array.prototype.length
- 动手动脑之Stringequals()方法,整理String类的Length(),charAt(),getChars(),replace(),toUpperCase(),toLowerCase(),trim(),toCharArray()使用说明
- tensorflow编译错误Cannot find gcc or CC (gcc -std=gnu99), either correct your path or set the CC environment variable
- 【Android】ListView ViewHolder ArrayIndexOutOfBoundsException: length=2; index=2
- scala中为什么针对array和string的长度计算推荐size,而不是length
- n个数字连乘的计算(Variable-Length Argument List)
- Oracle:environment variable "PATH" does not exceed the recommended length
- How do I read in a character variable with varying length in a space delimited dataset?
- how to increase an regular array length in java?
- [Msg] Failed - Error on Function ARRAY_LENGTH - 1227 - Access denied
- ListView报错:ListView中使用type需要注意的东西 java.lang.ArrayIndexOutOfBoundsException: length=2; index=2 addScr
- find length of longest consecutive subsequence S in an unsorted array where min * 2 > max.
- shell 几中专用修饰符 :- :+ := ${variable:offset:length}