小编JT.*_*JT.的帖子

/ in vi搜索和替换?

在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)

我错过了什么?

vim text replace

61
推荐指数
5
解决办法
6万
查看次数

C++ nil vs NULL

好的,我在头文件中有一些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++ null

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

C++标题 - 包含时的最佳实践

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)

有性能问题吗?明显的好处?这有什么不好的吗?

c++ header

5
推荐指数
3
解决办法
2729
查看次数

没有类型的声明

我很迷惑.

我这样做:

#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抱怨.有什么问题?

有一个很好的参考?

[编辑]这是整个标题在这里

c++ xcode vector

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

标签 统计

c++ ×3

header ×1

null ×1

replace ×1

text ×1

vector ×1

vim ×1

xcode ×1