由买买提看人间百态

topics

全部话题 - 话题: sizeof
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
a9
发帖数: 21638
1
来自主题: Programming版 - c的问题(2)
sizeof是sizeof了指针。你不能这么搞。
你在malloc的时候已经知道长度了啊,不就是sizeof(float)*n吗?
T********i
发帖数: 2416
2
算了我给你一个吧。你问这些正经问题纯粹浪费时间。
static std::string get_exepath() {
#ifdef _WIN32
char l_name[MAX_PATH + 1];
l_name[sizeof(l_name) - 1] = 0;
::GetModuleFileName(NULL, l_name, sizeof(l_name) - 1);
return std::string(l_name);
#else
char buff[1024];
ssize_t len = ::readlink("/proc/self/exe", buff, sizeof(buff)-1);
if (len != -1) {
buff[len] = '
b*********n
发帖数: 1258
3
关于你写的代码,有2个问题
那个for循环,为什么终止条件是i < sizeof(long double)/sizeof(int)
而不是i < sizeof(long double)
另外我觉得应该那个for循环写成while(p[i]!='\0')
不知道我的想法对不对
哈哈
谢谢
可能是一个newbie的问题了
谢谢

0.972384732814682914678216478321647832647382614738...;
code=0.9723847328146829146782164783216478326473826147382614873216483721648732
w****n
发帖数: 31
4
来自主题: Computation版 - 老大们再帮一把吧
re-run the code with the folloiwng modify but sitll not working.
#include
int main()
{
long double a;
a = 1.0/3.0;
printf("%40.40Lf\n",a);
printf("float=%d\n", sizeof(float));
printf("double=%d\n", sizeof(double));
printf("long double=%d\n", sizeof(long double));
return 0;
}
mary015-01dhcp57:/home/wilson/program/PRECISION # icc -long_double long.c
mary015-01dhcp57:/home/wilson/program/PRECISION # ./a.out
0.333333333333333314829616256
m********0
发帖数: 2717
5
来自主题: Quant版 - C++ and threading interview questions
I am sure about my result with gnu cpp stl
with g++ compiler.
Tested.
sizeof could not be zero, sizeof(empty clas) = 1;
and for sizeof(vector) I guess the reason is
it only counts three pointers
_M_start, _M_finish, _M_end_of_storage

max_
t*******r
发帖数: 22634
6
sizeof(coutable infinite set) / sizeof(uncountable infinite set) = 0
好像您是对的,另外求证明过程。。。
C**********r
发帖数: 31
7
bloomberg电话面试了两轮,感觉问题又多又琐碎,每次面完了我都想挠人
我是在bloomberg网上投的简历,financial software engineer, 投了2天就来email
set up 第一轮 phone interview了。第一轮问了大概没有40个问题也有30个,而且什
么都问,编程,算法,操作系统,网络,数据库。。。而且都问的很细,足足问了一个
半小时,放下电话我满头是汗手都软了,感觉就像刚在工地干了一天活,当时就觉得肯
定没戏了。侥幸过了第一轮,又来email约第二轮,一定想把我约在上午,我说我这是
西岸,上午太早了,他们就说等有时间再通知我,这一等就是一个月,刚才才面完。这
次是个老印,说话叽里咕噜,问题也还是又多又琐碎,我也答的乱七八糟,这次是真的
过不了了,把能记起来的两次的面试题发在下面,因为太多太杂,实在不能保证记得清
楚完整,大家凑合看吧:
1、关于c++里面static的,追问了很多细节,怎么用,在哪里分配之类的,还问到
static作为函数的argument
2、跟sizeof相关的,好像是想问sizeof一个指针和指针指向的空间又什么不
w********p
发帖数: 948
8
来自主题: JobHunting版 - 讨论个subarray sum的变种问题
code is here, I run it simply, it looks good
O(n) for running time, and O(1) for space
#include
#include
#include
using namespace std;
int SumKMember(int iArray[],int startIndex, int endIndex, int sum);
int main (int argc, char *args[]) {
if (argc != 2) {
cout<<"comment line: a.exe number\n";
return 0;
}
int k=atoi(args[1]);
//n is the array size
int maxSum=-99999999;

int iArray[] = {1, 2 , 4 , -3, 5 ,2};
int n = sizeof( iArray) /sizeof
n*******s
发帖数: 482
9
来自主题: JobHunting版 - 算法题目一问
l's inital value would be
L[0][0] = 0
L[1][0] = a[0]
since, L[0][i] means the possible max if the ith does not donate
L[1][i] means the possible max if the ith does donate
Here is the code:
int a[] = { 94, 40, 49, 65, 21, 21, 106, 80, 92, 81, 679, 4, 61, 6, 237
, 12, 72, 74, 29, 95, 265, 35, 47, 1, 61, 397, 52, 72, 37, 51, 1, 81, 45,
435, 7, 36, 57, 86, 81, 72 };
int size = sizeof(a)/sizeof(int);
int l[2][size];
int m[size];
int type=0;
int i =0, j=0, max=0;
m
z***e
发帖数: 5393
10
来自主题: JobHunting版 - 一道 C++ 的题。
interesting, why do you think it doesn't work for vptr? vptr is nothing just
a pointer, kind like:
class A
{
void* pVtbl;
int value;
public:
A(int v):value(v) {};
};
then:
A temp(123);
A* pBuffer = (A*)malloc(sizeof(A)*500);
for(int i=0;i<500;++i)
{
mempcy(pBuffer++, &temp, sizeof(A));
}
这个问题应该是让你模仿vector去实现类似功能(不是直接让你用vector)

这个array还是没法用
a********a
发帖数: 219
11
来自主题: JobHunting版 - 寻找子序列/子段落
给自己积点福。
int match[100][100];
string sub(string a, string b) {
int oo = 10000000001;
int mn = oo;
int pos = -1;
memset(match, oo, sizeof(match));
memset(match[0], 0, sizeof(match[0]));
for(int i = 1; i <= b.size(); i ++)
for(int k = 1; k <= a.size(); k ++) {
match[k][i] = match[k - ((b[i - 1] == a[k - 1]) ? 1 : 0)][i - 1]
+ 1;
pos = ((k == a.size() && match[k][i] < mn) ? i : pos);
mn = (pos == i) ? match[k][i] : mn;
}
return (mn == o
w******h
发帖数: 16
12
【 以下文字转载自 Programming 讨论区 】
发信人: windrush (just do it), 信区: Programming
标 题: 大家新年好。 请教一个 c interview question
发信站: BBS 未名空间站 (Mon Feb 15 14:53:21 2010, 美东)
Func1 用来create 一个指针数组。每个指针指向一个struct node myNode
void Func1 (myNode*** p)
{
// len is a global value
myNode** tmp;
tmp = (myNode**) malloc(sizeof(myNode*) * len);
p = &tmp;
……
for (int i=0; i {
(*p)[i] = (myNode*)malloc(sizeof(myNode));
……
}
}
Func2用来处理这个指针数组和回收memory
void Func2 (void)
{
myNode** p;
s***t
发帖数: 49
13
来自主题: JobHunting版 - 关于数组size的问题
func(arr, sizeof(arr)/sizeof(int))

si
无法
x**y
发帖数: 10012
14
来自主题: JobHunting版 - 关于数组size的问题
sizeof(arr)/sizeof(*arr);

si
无法
f****4
发帖数: 1359
15
class Mem{
public:
void* operator new(size_t n, int a);
void operator delete(void* p);
};
Mem* a = new(10) Mem;
a->~Mem();
delete a;
// operator new & delete work correctly
void* buf = malloc(sizeof(Mem)+sizeof(int));
Mem* b = new(buf) Mem; // wrong
b->~Mem();
free(buf);
我发现只要重载了operaor new之后,缺省的placement new的表达就出错了
重载 void* operator new(size_t n, void* buf);之后又好了
问题是我重载的这个void* operator new(size_t n, void* buf),是不是placement
new?有人说placement new是不能重载的(http://cyclopedia.name/post/e6b58
w******1
发帖数: 520
16
有1,2,....一直到n的无序数组,求排序算法,并且要求时间复杂度为O(n),空间复杂
度O(1),使用交换,而且一次只能交换两个数.(华为)
分析:数组的特点是值和下标满足一定的关系,以此作为交换的终止条件。
但这个算法的时间复杂度如何证明是O(n)呢?
#include
int main()
{
int a[] = {10,6,9,5,2,8,4,7,1,3};
int len = sizeof(a) / sizeof(int);
int temp;
for(int i = 0; i < len; )
{
if ( a[i] != i + 1)//下标和值不满足对应关系
{
temp = a[a[i] - 1]; //不相等的话就把a[i]交换到与索引相应的位置
a[a[i] - 1] = a[i];
a[i] = temp;
}
else
i++; // 保存,以后此值不会再动了
}
for (int j = 0; j < len; j++)
cout< return 0;
}
h**6
发帖数: 4160
17
来自主题: JobHunting版 - 问个stl的iterator问题
I think you can use a pointer to an iterator as below:
typdef vector vi;
void main()
{
int input[] = {1, 4, 5};
vi weight = vi(input, input+sizeof(input)/sizeof(input[0]));
vi::iterator it1 = weight.begin();
vi::iterator it2 = weight.end()-1;
vi::iterator *pit = new vi::iterator;
if(1+1 == 3)
*pit = it1;
else
*pit = it2;
int result = **pit;
delete pit;
cout< }
z*****j
发帖数: 6
18
1) char * ptr = “Hello”;
sizeof(ptr) = ?
a. 1
b. 4
c. 5
d. 6
2) char obj[10][20][30];
sizeof(obj) = ?
a. 6000
b. 600
c. 60
d. 1
3) char c = 127; c = c + 10;
Which of the following is true?
a. c > 0
b. c = 0
c c < 0
d .c >= 0
4) double a = 5/10*2.0;
a = ?
a. 0
b. 0.25
c. 1
d. 0.05
5) int a = 2|1; //Bitwise OR operation
a = ?
a. 0
b. 1
c. 2
d. 3
6) int a = 3^1; //Bitwise XOR operation
a = ?
a. 0
b. 1
c. 2
d. 3
7) #include
int main()
{
int a = 5;
{int a = 6;cout< return 0;
}
Wha
B*****t
发帖数: 335
19
不解释了, 给你个code参考一下就明白了
#include
using namespace std;
int main() {
const int ANumNotInArray = 0x7fffffff;
class Node {
public:
int x, cnt;
}d[3];
int m[] = {3, 2, 6, 3, 2, 1, 6, 3, 6, 2, 7};
int n, i, j;
n = sizeof(m)/sizeof(int);
bool found = false;
for(i=0; i<3; i++) {
d[i].x = ANumNotInArray;
d[i].cnt = 0;
}
for(i=0; i for(j=0; j<3; j++) {
if(m[i]==d[j].x) {
d[j].cnt++; f
B*****t
发帖数: 335
20
又改了一下,你看看还有没有bug
#include
using namespace std;
int main() {
const int ANumNotInArray = 0x7fffffff;
class Node {
public:
int x, cnt;
}d[3];
int m[] = {3,3,3,7,2,2,6,1,6,2,6};
int n, i, j, ix;
n = sizeof(m)/sizeof(int);
bool found = false;
for(i=0; i<3; i++) {
d[i].x = ANumNotInArray;
d[i].cnt = 0;
}
for(i=0; i for(j=0; j<3; j++) {
if(m[i]==d[j].x) {
d[j].cnt++; found = true
j**l
发帖数: 2911
21
来自主题: JobHunting版 - 离奇的Amzaon第一轮电面
如果sizeof(int) == sizeof(long) == 4
虽然运行结果也对,
但就好比4位时候1000 - 1 = 0111, 背后实际上是 -8 - 1 = +7
最好用
unsigned long num = 1;
num <<= (bits - 1);
long max_int = num - 1;
f*********g
发帖数: 207
22
来自主题: JobHunting版 - 问一个bloomberg的面试题
抛砖引玉,写错了,囧
long fofarray(int* a)
{
long n = sizeof(*a) / sizeof(int);
long res[10];
while(n--)res[a[n]]++;
return res;
}
b********h
发帖数: 119
23
for (int i=0;i 这个sizeof用的有点离谱了吧

Engineer
s******n
发帖数: 57
24
啊!!!这个确实是错了,应该是sizeof(integers)/sizeof(int).ok,看来不冤了,谢
谢。
w******1
发帖数: 520
25
是的,直接用12 没问题啊。
不过这个例子的重点是说明
sizeof(dis) / sizeof(dis[0]));
这样就有很强的移植性。
e******l
发帖数: 26
26
来自主题: JobHunting版 - 中国人面试果然很好人
你说的没错,测试了一下
struct
{
char c;
};
sizeof=1
struct
{
char c;
int i;
int *j;
};
sizeof=12
o...您这才是jobhunting的人应该有的实力
惭愧
e****9
发帖数: 316
27
来自主题: JobHunting版 - C++里get array size的问题
#ifndef ARRAYSIZE
#define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
#endif
f****4
发帖数: 1359
28
来自主题: JobHunting版 - 面经-facebook, amazon,telenav, quantcast
第一题,如果你把a,b数组当作参数传进去的话,不传数组长度进去,bstradd怎么能
知道数组多长?
bstradd(a, b)里面的 sizeof(a)/sizeof(char) == 1
i**********e
发帖数: 1145
29
来自主题: JobHunting版 - 面经-facebook, amazon,telenav, quantcast
当你传一个数组进去的时候,在函数内得到的只是指向数组第一个位置的一个指针。(
不管你函数定义的是 int *a 或者 int a[],编译器都直接转换成 int *a)。
所以如果你在函数内利用 sizeof(a) 的话,那得到的永远是 4,也就是指针的 size,
而不是数组的 size。除非你数组内有个 sentinel 值(类似 c string 的 '\0'),不然你必须传数组的长度进函数。
那为什么在定义了 int a[],然后 sizeof(a) 可以告诉数组的总共 size (in bytes)
呢?因为这里 a 是数组,不是指针。你虽然可以利用 *(a + 3) 来得到 a[3],但是你
不能像指针一样,可以 a++ 或者 a--。因为数组与指针的特别关系,所以数组也称为
constant pointer。
一些常见面试题的答案与总结 -
http://www.ihas1337code.com
c****s
发帖数: 241
30
来自主题: JobHunting版 - bloomberg相关的面试题
以前一直说要总结一下自己的面试题,总是忘了,现在补上。
面试我的是替bloomberg找人的consultant公司,这些题目主要是c,c++的知识题。下
面主要是我跟那个HR的聊天记录。有的答得不好,也可能有错误,仅供大家参考:
11:56 AM recruiter: // What happens?
int main()
{
return main();
}
11:58 AM // What prints?
void main()
{
static int var = 5;
printf("%d ",var--);
if(var) main();
}
11:59 AM // What prints?
void main()
{
char *p;
printf("%d %d ",sizeof(*p), sizeof(p));
}
12:00 PM // What prints?
#define a 10
void main()
{
#define a 50
printf("%d",a);
}
// What prints?
void main ()
{
c**********e
发帖数: 2007
31
来自主题: JobHunting版 - C++ Q41: std::sort (C4)
How do you use STL's std::sort algorithm to sort an array declared as int v[
1000]?
a) std::sort(v);
b) std::sort(v,v+1000);
c) std::sort((void*)v, 1000, sizeof(int), sortInt);
(assuming sortInt is defined properly)
d) std::sort((void*)v,(void*) &v+1000, sizeof(int));
e) std::sort(v.begin(),v.end());
b********h
发帖数: 119
32
来自主题: JobHunting版 - 请问以下程序运行结果
跑了一下
i=5 j=4 k=10
似乎sizeof里面的++根本没做。因为不管值是多少,sizeof的都是一个int。
c**********e
发帖数: 2007
33
来自主题: JobHunting版 - C++ Q58: size of pointer (Bloomberg)
char *p;
printf("%d%d\n",sizeof(*p), sizeof(p));
What is the output?
a) 14
b) 18
c) depends on implementation
g*****7
发帖数: 111
34
来自主题: JobHunting版 - 一个实际的排序问题
我不知道怎么在你说的前提下一次完成给vector排序和记录index。可以先记录index再
根据index排序吗?
using namespace std;
class MyCompare
{
public:
MyCompare(const double* array) : d_array(array) {} // doesn't own array
bool operator() (int i, int j)
{
return d_array[i] < d_array[j];
}
private:
const double* d_array;
};
int main()
{
double array[] = {1., 5., 1.5, 3., 0.24, 11., 7.};
const size_t n = sizeof(array)/sizeof(array[0]);
int* indices = new int[n];
for (size_t i = 0; i < n; ++i)
indices[i] = i;
MyCom
r***u
发帖数: 241
35
来自主题: JobHunting版 - Apple的一些C++概念题
很久没碰C++了,有一些没答好,但还是拿到了onsite
我记得的问题有:
1. struct 和 class的区别
2. 什么是partially specialized template
3. 如果一个程序在main函数执行前就crash了,是什么原因
4. 如何防止一个类被拷贝
5. 能不能直接调用析构函数
6. 什么是virtual function,效率如何,调用一次发生几次indirection
7. 32位机,一个类定义一个整数,一个虚函数,sizeof是多少。
另一个类定义一个整数,两个虚函数,sizeof是多少。
8. 能不能在constructor里面调用虚函数
y*******o
发帖数: 6632
36
来自主题: JobHunting版 - Apple的一些C++概念题
1. struct 和 class的区别
class default private, struct default public, nothing more
2. 什么是partially specialized template
3. 如果一个程序在main函数执行前就crash了,是什么原因
4. 如何防止一个类被拷贝
private assignment operator, private copy constructor
5. 能不能直接调用析构函数
yes
6. 什么是virtual function,效率如何,调用一次发生几次indirection
1 ?
7. 32位机,一个类定义一个整数,一个虚函数,sizeof是多少。
8
另一个类定义一个整数,两个虚函数,sizeof是多少
12
8. 能不能在constructor里面调用虚函数
never ever do it, according to effective c++
l********n
发帖数: 54
37
来自主题: JobHunting版 - C++问题
用template只能做到这样,不过#type想不出如何打印出来
#include
using namespace std;
template
inline void PrintSize()
{
cout<<"sizeof "<<" is " << sizeof(T)< }
int main(void)
{
PrintSize();
return 1;
}
h***o
发帖数: 1494
38
来自主题: JobHunting版 - 问一道Google Intern的面试题

按正负数,先分成两组
group1: 20,10,20
group2: 40,10
问题就变成了,有一个arrary,几个sum,怎么把array里的整数分组,使得每一组的
sum等于
each sum?
if sizeof(group1) return false;
Sort group1 and group2, so
group1: 10,20,20 (size:n)
group2: 10,40 (size:m)
if(group1[0]>group2[0] || group1[n]>group[m])
return false;
foreach(i in group1)
{
if(i in group2)
remove i from group1 and group2;
}
so,
group1: 20, 20 (size:n)
group2: 40 (size:m)
for(int i=1;i {
sum group1[0]+group1[1]...
if(the sume... 阅读全帖
a****n
发帖数: 1887
39
来自主题: JobHunting版 - C++问题3
memset 第二个参数是unsigned char, 不过这个是经典的memset 错误用法
memset (str,1,sizeof(str));
memset (str,0xff00,sizeof(str));
j*****g
发帖数: 223
40
// txt -> text
// p -> pattern (include . and *)
void pattern_match(const char *txt, const char *p)
{
int **d = NULL;
int len_txt = 0, len_p = 0;
int i, j, k;
if (!txt || !p) goto exit;
len_txt = strlen(txt);
len_p = strlen(p);
if (len_txt == 0 || len_p == 0) goto exit;
printf("text : %s\n", txt);
printf("pattern: %s\n", p);
d = new int*[len_p];
if (!d) goto exit;
memset(d, NULL, sizeof(int*) * len_p);
for (i = 0; i < len_p; i++)
{
... 阅读全帖
x****k
发帖数: 2932
41
来自主题: JobHunting版 - 面经兼求祝福
一家IB的Analytics developer的onsite,只记得部分题目,一些比较简单的题目就不
写了。括号后是我认为的答案或者提示。
1. write a iterative function to calculate fibonacci sequence
2. what is the difference of Delete table and truncat table.(about sql &
database)
3. what is ACID.(about sql or database)
4. write a find() for BST, How to decide the element could not be found.((
less than && No left child) || (large than && no right child))
5. how to reverse a link list using one point
(should I use recursive calling)
6. find the sizeof(int) wit... 阅读全帖
j****k
发帖数: 91
42
来自主题: JobHunting版 - 请问这样写程序错了吗?
二楼应该是这个题目的正解.
但是如果稍微改一下题目, 把pString1,2的定义改为:
char *pString1, *pString2;
pString1 = (char *)malloc(3*sizeof(char));
pString2 = (char *)malloc(21*sizeof(char));
strcpy(pString1,"AAA");
strcpy(pString2,"BBBBBBBBBBBBBBBBBBBB");
这样在for循环里走过第三步的时候pString1就已经到头了, 但为什么接下来的循环都
不会出错? 虽然说c++没有边界检测, 但程序在修改pString1越界指向的内容, 这难道
不该是Access violation吗?
l**********3
发帖数: 161
43
第一题可不可以这么做,O(N)的方法,请大虾指教。
#include
using namespace std;
typedef struct best_days {
int buy;
int sell;
} best_days_t;
best_days_t get_best_days(double* prices, int days){
best_days_t best;
best.buy = best.sell = -1;

int minday = 0;
double dmax = 0.0f;
double minprice = prices[0];

for (int i=1; i if (prices[i] - minprice > dmax){
dmax = prices[i] - minprice;
best.sell = i;
best.buy = minda... 阅读全帖
c***2
发帖数: 838
44
来自主题: JobHunting版 - Amazon 面经
/*
sizeOfArray: how many lines
sizeOfRecord: size of each line
*/
unsigned char **get(int sizeOfArray, int sizeOfRecord)
{
unsigned char **p;
int i;

p=(char**)malloc(sizeof(char*)*sizeOfArray);
for(i=0;i p[i]=(char*)malloc((sizeOfRecord+1)*sizeof(char));
}

return p;
}
void release(unsigned char **ptr, int sizeOfArray)
{
int i;

for(i=0;i free(ptr[i]);
}
free(ptr);
}
x****k
发帖数: 2932
45
来自主题: JobHunting版 - C++相关的面经
银行相关的职位,题目比较多,尽量拣记得住的写一下。
1. the difference of new/delete malloc/free. what if new/free, and malloc/
delete?
2. sizeof an empty class
3. sizeof an empty class with virtual function.
4. can we call virtual function in constructor/destructor?
5. what is pure virtual function?
6. How to disable class initialized on heap,
7. How disable class initialized on stack,
8. where static varible saved, heap or stack?(bss, data)
9. what does static mean in C++
10. what is 4 default functions for empty class
... 阅读全帖
H******7
发帖数: 1728
46
来自主题: JobHunting版 - 看到一个c的面试题,求教。
还有:
p = (char *) & target + sizeof(int)-1;
这句话看着有点奇怪? 后面加上 sizeof(int) -1 是在做什么?
恕我愚钝 不太明白。请指点。
n********y
发帖数: 66
47
欢迎拍砖,就用了一个 256 字节的table来检查一个数字是否出现过
#include
#include
#include
#include
char* nextpointer(char* str, int strlen)
{
char *p = str;
char *pend = str + strlen;
char count[256];
memset(count, 0, sizeof(count));
while (p < pend)
{
++count[*p];
if (count[*p] > 1)
{
return p;
}
++p;
}
return p;
}
void longestsingle(char* str, int strlen)
{
char *pstart = str;
char *pend... 阅读全帖
c******t
发帖数: 391
48
来自主题: JobHunting版 - 一道M$算法题。
How about this one? Is this O(NlogN) solution?
#include
#include
using namespace std;
void finddup(int arr[], int length){
hash_map hm;
cout< for(int i=0; i hm[arr[i]]++;
}
hash_map::iterator it;
int dup=0;
for(int i=0; i it=hm.find(arr[i]);
if(it->second>1){
dup=it->first;
cout< }
}
cout< }
void main(){... 阅读全帖
i****d
发帖数: 35
49
来自主题: JobHunting版 - 再问一个C的malloc( )
我给个例子吧。。。
再次之前先更正一下。。
int *a = malloc(10*sizeof(int)); 是不对的

int *a = (int *)malloc(10*sizeof(int));
另外,因为malloc分配的内存在堆上,需要手动free。但是a[10]分配的内存在stack上
,会自动被销毁的。。所以,你设想有这么一个函数。。
int *randomArray(int n);
让你生成一个大小为n的array,里面都是随机数,返回。你用啥?
j***y
发帖数: 2074
50
来自主题: JobHunting版 - 请教几个电面题

多谢,确实是这个问题。我的疏忽。改成remove_duplicate(arr, sizeof(arr)/sizeof
(arr[0]))了,编译通过,运行正常。多谢指出这个错误。
不过,Dev-C++似乎不支持unordered_map。这个模板类不在C++的标准库里面吗?但是
我用了1337coder的coding panel,也是有通不过这个模板类的编译。
为什么呢?
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)