由买买提看人间百态

topics

全部话题 - 话题: cdecl
(共0页)
t****t
发帖数: 6806
1
来自主题: Programming版 - 出个题考考大家:)
把fb去掉再来, cdecl不接受参数名, 比如说
cdecl> explain char foo(char)
declare foo as function (char) returning char
cdecl> explain char foo(char x)
syntax error
所以
cdecl> explain char *(*ff(char *(*)()))()
declare ff as function (pointer to function returning pointer to char)
returning pointer to function returning pointer to char
t****t
发帖数: 6806
2
来自主题: Programming版 - 谁给解释一下这个c question
教你一个偷懒的办法: 找个unix, 运行cdecl
cdecl> explain char **arr[12][12][12]
declare arr as array 12 of array 12 of array 12 of pointer to pointer to
char
cdecl> explain char ** (* p) [12][12]
declare p as pointer to array 12 of array 12 of pointer to pointer to char
S**I
发帖数: 15689
3
多谢指正。win32上argument的pass,stdcall和cdecl是往stack上push,fastcall和
thiscall是先用寄存器,然后再往stack上push。但是只有cdecl是调用函数clean up
stack,所以参数个数可变的函数调用应该只能是cdecl。

of
in
j***i
发帖数: 1278
4
来自主题: JobHunting版 - array of pointers to functions
用 cdecl 试一下就可以了
t****t
发帖数: 6806
5
来自主题: JobHunting版 - 请教一个c的概念题
exactly, 上面一堆人在讲什么cdecl, 拜托那是在比较&p和&q的情况下才会去看什么栈
方向ABI之类的东西.
k***e
发帖数: 1931
6
来自主题: JobHunting版 - 贴几道老题目
不至于要设计编译器吧,就是考基本概念:stdcall, cdecl, thiscall, fastcall
naked call,这几种属于常见的基础知识。

数。
t****t
发帖数: 6806
7
来自主题: Programming版 - 出个题考考大家:)
just use cdecl to "explain" it and you get the result.
s*******o
发帖数: 392
8
刚开始看www.cplusplus.com上的tutorial文档,在73页写到了关于function pointer
的用
法,可是我录入后报错,希望大家帮忙看看
#include
using namespace std;
int addition (int a, int b)
{
return(a + b);
}
int subtraction (int a, int b)
{
return(a - b);
}
int operation(int x, int y, int (* functocall(int x, int y)))
{
int g;
g = (*functocall(x, y));
return(g);
}
int main()
{
int m;
int (*minus)(int, int) = subtraction;
m = operation(7 , 5, minus);

std::cout << m;
system("PAUSE");
re... 阅读全帖
h*******s
发帖数: 8454
9
来自主题: Programming版 - int (*b)[2]; 是什么意思?
要是能用电脑的话
好像有个软件还是网站叫c++decl还是cdecl专门把这种诡异的声明翻译成英语的
t****t
发帖数: 6806
10
来自主题: Programming版 - int (*b)[2]; 是什么意思?
there was a tool called cdecl, that translate between english and C. now the
tool seems to disappear from default linux installation.
h*******s
发帖数: 8454
11
来自主题: Programming版 - int (*b)[2]; 是什么意思?
放狗搜了一下,现在弄了个网站
http://cdecl.org/
不过我还真不知道这东西以前在linux发行版里面

the
t****t
发帖数: 6806
12
as xentar said, this tightly depends on specific ABI used. even on windows
32bit, cdecl, stdcall, fastcall, etc. are all different (of course, some of
them do not support variadic).
for example, on x86-64/linux, %al will be set to number of registers used in
variadic function call. although in all conventions, variadic calls must
let callee to find "..." parameters from the last fixed parameter.
D*****r
发帖数: 6791
13
来自主题: Programming版 - int *a [] 和int (*a)[] 一样吗
cdecl.org
int* a[] ==> declare a as array of pointer to int
int (*a) [] ==> declare a as pointer to array of int
(共0页)