小编spe*_*ncs的帖子

如何使用SQL将列定义为64位整数

我正在创建一个表如下:

create table SomeTable (
LoginTime int,
someValue 64bit-int
)
Run Code Online (Sandbox Code Playgroud)

如何将第二列定义为64位整数?

mysql sql integer

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

为什么编译器会抱怨这个宏声明

为了调试方便,我编写了以下宏

1 #ifndef DEF_H
2 #define DEF_H
3 #define DEBUG_MODE
4 #define DEBUG_INFO(message)     \
5         #ifdef DEBUG_MODE       \
6                 cout << message << endl; \
7         #endif                          \
8 #endif
Run Code Online (Sandbox Code Playgroud)

但gcc抱怨如下

def.h:4: error: '#' is not followed by a macro parameter
def.h:1: error: unterminated #ifndef
Run Code Online (Sandbox Code Playgroud)

这段代码有什么问题?我在这里错过了一些重点吗?

c debugging c-preprocessor

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

为什么python中的__init__失败

我正在使用python2.7来定义这样的函数

def foo(*args, **kwargs):
    print 'args = ', args
    print 'kwargs = ', kwargs
    print '---------------------------------------'
Run Code Online (Sandbox Code Playgroud)

并通过调用foo(3),输出如下:

args =  (3,)
kwargs =  {}
Run Code Online (Sandbox Code Playgroud)

这是所希望的.

但是对于__init__参数与foo相同的类中的函数,我无法通过调用实例化类PersonPerson(3)

def Person():
    def __init__(self, *args, **kwargs):
        print args
        print kwargs
x = Person(3)
Run Code Online (Sandbox Code Playgroud)

输出是

    x = Person(3)
TypeError: Person() takes no arguments (1 given)
Run Code Online (Sandbox Code Playgroud)

这让我很困惑,我错过了什么吗?

python class init

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

标签 统计

c ×1

c-preprocessor ×1

class ×1

debugging ×1

init ×1

integer ×1

mysql ×1

python ×1

sql ×1