小编Jam*_*ath的帖子

嵌套的typedef结构

我在尝试嵌套需要声明为新的var类型的结构时遇到问题。代码如下-

typedef struct
{
    typedef struct
    {
        int day,
            month,
            year;
    } Date;

    Date manuDate,
         purDate;
    double purPrice;
} Car;
Run Code Online (Sandbox Code Playgroud)

除了我尝试编译时,它会向我说一个错误

“ typedef之前的语法错误”以及由于该错误而导致的其他错误。

这是C不能做的事情吗?我知道它在没有指针的情况下存在嵌套结构问题,但是我不确定在这种情况下如何工作...

c ansi-c

3
推荐指数
2
解决办法
3593
查看次数

多个Actionscript 3层

我想知道我是否将用于不同部分的某些代码分成不同的层,它们之间是否有功能,或者作为单独的东西.(我可以在另一层上引用变量吗?)

基本上我有一组代码可以在每个帧中运行,但也需要特定于某些帧的代码,但仍然能够访问主代码.

谢谢

flash actionscript layer actionscript-3

2
推荐指数
1
解决办法
1657
查看次数

不能使用 'Object 作为类名,因为它是保留的 Cake 2.2.x

我在尝试设置我们正在运行的站点的测试副本时遇到问题,我在 Mint VM 下安装了文件和应用程序,当我将 apache 指向目录时,出现 500 错误和以下内容-

[Thu Oct 25 15:09:39.714201 2018] [php7:error] [pid 8945] [client 192.168.0.14:52237] PHP Fatal error:  Cannot use 'Object' as class name as it is reserved in /home/jamesmcgrath/Documents/dashboard/lib/Cake/Core/Object.php on line 30
[Thu Oct 25 15:09:39.714547 2018] [php7:error] [pid 8945] [client 192.168.0.14:52237] PHP Fatal error:  Uncaught Error: Class 'Controller' not found in /home/jamesmcgrath/Documents/dashboard/lib/Cake/Error/ExceptionRenderer.php:174\nStack trace:\n#0 /home/jamesmcgrath/Documents/dashboard/lib/Cake/Error/ExceptionRenderer.php(92): ExceptionRenderer->_getController(Object(InternalErrorException))\n#1 /home/jamesmcgrath/Documents/dashboard/lib/Cake/Error/ErrorHandler.php(126): ExceptionRenderer->__construct(Object(InternalErrorException))\n#2 /home/jamesmcgrath/Documents/dashboard/lib/Cake/Error/ErrorHandler.php(284): ErrorHandler::handleException(Object(InternalErrorException))\n#3 /home/jamesmcgrath/Documents/dashboard/lib/Cake/Error/ErrorHandler.php(213): ErrorHandler::handleFatalError(64, 'Cannot use 'Obj...', '/home/jamesmcgr...', 30)\n#4 /home/jamesmcgrath/Documents/dashboard/lib/Cake/Core/App.php(933): ErrorHandler::handleError(64, 'Cannot use 'Obj...', '/home/jamesmcgr...', 30, Array)\n#5 /home/jamesmcgrath/Documents/dashboard/lib/Cake/Core/App.php(906): …
Run Code Online (Sandbox Code Playgroud)

php cakephp cakephp-2.2 cakephp-2.x php-7.2

1
推荐指数
1
解决办法
2万
查看次数

Ruby - mathematica样式元组列表

我正在玩各种变量组合的大型列表,我很好奇,如果ruby实现了一种方法来生成这些列表给定长度和变量列表,就像mathematica处理元组一样.

给定长度3和变量a,b和c,它将输出一个或多个a,b,c,3长组合的数组或数组

abc acb bac bca cab cba

通常这很容易做到,除了我使用长度为10-15且有10个左右的vars的列表

ruby arrays tuples list

0
推荐指数
1
解决办法
99
查看次数