在vi中,搜索和替换,如何逃避'/'(正斜杠)以使其正确.说道.
喜欢:/ Users/tom/documents/pdfs /
:%s//Users/tom/documents/pdfs//<new text>/g --FAILS (obviously)
:%s/\/Users/tom/documents/pdfs\//<new text>/g -- FAILS with a trailing error
:%s/'/Users/tom/documents/pdfs/'/<new text>/g -- FAILS with a trailing error
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
好的,我在头文件中有一些C++代码,声明如下:
void StreamOut(FxStream *stream,const FxChar *name = nil);
Run Code Online (Sandbox Code Playgroud)
我得到:错误:
'nil' was not declared in this scope
Run Code Online (Sandbox Code Playgroud)
零是一个帕斯卡的事,对吗?
我应该使用NULL吗?
我以为它们都是相同的,或者至少是零,不是吗?
C++标头
如果我有A.cpp和Ah以及bh,ch,dh
我应该这样做:
在啊:
#include "b.h"
#include "c.h"
#include "d.h"
Run Code Online (Sandbox Code Playgroud)
在A.cpp中:
#include "A.h"
Run Code Online (Sandbox Code Playgroud)
要么
在A.cpp中:
#include "A.h"
#include "b.h"
#include "c.h"
#include "d.h"
Run Code Online (Sandbox Code Playgroud)
有性能问题吗?明显的好处?这有什么不好的吗?
我很迷惑.
我这样做:
#include <vector>
// List iteration
typedef vector<registeredObject>::iterator iterator;
typedef vector<registeredObject>::const_iterator const_iterator;
vector<registeredObject>::iterator begin(void);
vector<registeredObject>::const_iterator begin(void) const;
vector<registeredObject>::iterator end(void);
vector<registeredObject>::const_iterator end(void) const;
Run Code Online (Sandbox Code Playgroud)
我得到的错误如下:
.: error: ISO C++ forbids declaration of 'vector' with no type
.: error: expected ';' before '<' token
Run Code Online (Sandbox Code Playgroud)
对于矢量的上述每个用途.这段代码在较旧的CodeWarrior中编译,但XCode抱怨.有什么问题?
有一个很好的参考?
[编辑]这是整个标题在这里