小编jac*_*hab的帖子

Linux新手:Linux vs POSIX手册

$ apropos mkfifo
mkfifo (1)           - make FIFOs (named pipes)
mkfifo (1posix)      - make FIFO special files
mkfifo (3)           - make a FIFO special file (a named pipe)
mkfifo (3posix)      - make a FIFO special file
mkfifoat (3)         - make a FIFO (named pipe) relative to a directory file ...
Run Code Online (Sandbox Code Playgroud)

所以我有Linux程序员手册和POSIX程序员手册的手册页.我应该选择哪个?为什么?(我正在编写Linux应用程序,没有计划将它移植到AIX,BSD等)

谢谢.

linux posix

4
推荐指数
1
解决办法
2638
查看次数

在SQL中,select语句中的表名之后的字母是什么?

SELECT a.NAME, a.NUMBER, a.STRING, a.RDB$DB_KEY FROM ADMIN a
Run Code Online (Sandbox Code Playgroud)

什么代表什么?

谢谢.

sql

4
推荐指数
1
解决办法
8772
查看次数

使用预处理器取消std :: cout代码行

可以删除所有printf()使用的呼叫#define printf.如果我有很多调试打印std::cout << x << endl;怎么办?如何cout <<使用预处理器快速关闭单个文件中的语句?

c++ cout c-preprocessor

4
推荐指数
5
解决办法
3862
查看次数

强制接口的模板

是否可以创建一个模板来接受实现某些接口的类型?例如,我想对模板用户说:只要它实现Init()Destroy()方法,你可以在我的容器中存储任何东西.

谢谢

c++ inheritance templates

4
推荐指数
1
解决办法
1378
查看次数

memmem()STL方式?

有没有一个STL算法可以用来搜索缓冲区内的字节序列,就像memmem()那样?

c++ stl

4
推荐指数
1
解决办法
2420
查看次数

在Python中使用正则表达式删除重复的单词

我需要删除字符串中的重复单词,以便'the (the)'成为'the'.为什么我不能这样做?

re.sub('(.+) \(\1\)', '\1', 'the (the)')
Run Code Online (Sandbox Code Playgroud)

谢谢.

python regex

4
推荐指数
1
解决办法
1781
查看次数

如何在C++中转换指针

void foo(void **Pointer);

int main ()
{
    int *IntPtr;

    foo(&((void*)IntPtr));
}
Run Code Online (Sandbox Code Playgroud)

为什么我会收到错误?

error: lvalue required as unary ‘&’ operand
Run Code Online (Sandbox Code Playgroud)

谢谢

c++ types pointers casting

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

重载增量的返回值

在他的C++编程语言中,Stroustrup为inc/dec重载提供了以下示例:

class Ptr_to_T {
    T* p;
    T* array ;
    int size;
public:
    Ptr_to_T(T* p, T* v, int s); // bind to array v of size s, initial value p
    Ptr_to_T(T* p); // bind to single object, initial value p
    Ptr_to_T& operator++(); // prefix
    Ptr_to_T operator++(int); // postfix
    Ptr_to_T& operator--(); // prefix
    Ptr_to_T operator--(int); // postfix
    T&operator*() ; // prefix
}
Run Code Online (Sandbox Code Playgroud)

为什么前缀运算符通过引用返回,而后缀运算符按值返回?

谢谢.

c++ operator-overloading

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

与gcc 4.4.1的tcp.h错误

我刚刚升级到带有gcc 4.4.1的Ubuntu 9.1,我在编译应用程序时遇到问题:

/usr/include/linux/tcp.h:72: error: ‘__u32 __fswab32(__u32)’ cannot appear in a constant-expression
Run Code Online (Sandbox Code Playgroud)

cp.h中的行导致错误:

     ...
enum { 
    TCP_FLAG_CWR = __cpu_to_be32(0x00800000),
    TCP_FLAG_ECE = __cpu_to_be32(0x00400000),
    TCP_FLAG_URG = __cpu_to_be32(0x00200000),
    TCP_FLAG_ACK = __cpu_to_be32(0x00100000),
     ...
Run Code Online (Sandbox Code Playgroud)

有什么想法可以做些什么?

gcc compiler-errors

3
推荐指数
1
解决办法
1896
查看次数

为什么这个函数重载不起作用?

class CConfFile
{
    public:
        CConfFile(const std::string &FileName);
        ~CConfFile();
        ...
        std::string GetString(const std::string &Section, const std::string &Key);
        void GetString(const std::string &Section, const std::string &Key, char *Buffer, unsigned int BufferSize);
        ...
}

string CConfFile::GetString(const string &Section, const string &Key)
{
    return GetKeyValue(Section, Key);
}

void GetString(const string &Section, const string &Key, char *Buffer, unsigned int BufferSize)
{
    string Str = GetString(Section, Key);     // *** ERROR ***
    strncpy(Buffer, Str.c_str(), Str.size());
}
Run Code Online (Sandbox Code Playgroud)

为什么我too few arguments to function ‘void GetString(const std::string&, const std::string&, char*, …

c++ overloading

3
推荐指数
1
解决办法
254
查看次数