由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Quant版 - C++: how to dynamically allocate a 2-D array
相关主题
count unique values in file with 1 million rows (转载)C++ and threading interview questions
如何用R处理大文件 (转载)考个C++题
[合集] WorldQuant phone interviewC++里面如何最方便的表示这个数组的数组?
总结一下金融分析方面需要知道的知识再请教两道QuantC++面试题 (转载)
[合集] Need suggestions for two offers (intern)How to write this query in Oracle?
请教个C++的面世题请教一道面试题啊!关于SQL的!
说起smart pointerSQL combine two columns from two different tables no shared (转载)
某某 trading 的一道题问一道编程题
相关话题的讨论汇总
话题: allocate话题: int话题: c++话题: array
进入Quant版参与讨论
1 (共1页)
c**********e
发帖数: 2007
1
I want to dynamically allocate int Q[L+1][M+1]. I tried the following.
How to fix it?
int **Q = new int*[L+1]; // allocate the rows
for (i = 0; i < (L+1); i++) // now allocate the columns
*Q[i] = new int[M+1];
The error: cannot convert from 'int *' to 'int'
P********e
发帖数: 2610
2

int **Q = new int*[L+1]; // allocate the rows
for (i = 0; i < (L+1); i++) // now allocate the columns
Q[i] = new int[M+1];

【在 c**********e 的大作中提到】
: I want to dynamically allocate int Q[L+1][M+1]. I tried the following.
: How to fix it?
: int **Q = new int*[L+1]; // allocate the rows
: for (i = 0; i < (L+1); i++) // now allocate the columns
: *Q[i] = new int[M+1];
: The error: cannot convert from 'int *' to 'int'

c**********e
发帖数: 2007
3
Thanks a lot.

【在 P********e 的大作中提到】
:
: int **Q = new int*[L+1]; // allocate the rows
: for (i = 0; i < (L+1); i++) // now allocate the columns
: Q[i] = new int[M+1];

1 (共1页)
进入Quant版参与讨论
相关主题
问一道编程题[合集] Need suggestions for two offers (intern)
[合集] 总结一下金融分析方面需要知道的知识请教个C++的面世题
VANGUARD说起smart pointer
[合集] 继续作贡献,一道积分题。某某 trading 的一道题
count unique values in file with 1 million rows (转载)C++ and threading interview questions
如何用R处理大文件 (转载)考个C++题
[合集] WorldQuant phone interviewC++里面如何最方便的表示这个数组的数组?
总结一下金融分析方面需要知道的知识再请教两道QuantC++面试题 (转载)
相关话题的讨论汇总
话题: allocate话题: int话题: c++话题: array