我在C中有这个结构示例:
typedef struct
{
const char * array_pointers_of_strings [ 30 ];
// etc.
} message;
Run Code Online (Sandbox Code Playgroud)
我需要将此array_pointers_of_strings复制到新数组以进行排序字符串.我只需要复制地址.
while ( i < 30 )
{
new_array [i] = new_message->array_pointers_of_strings [i];
// I need only copy adress of strings
}
Run Code Online (Sandbox Code Playgroud)
我的问题是:如何通过malloc()分配new_array [i]仅用于字符串的地址?
我使用Visual Studio 2012和插件Visual assist X ver.我有两个问题.
1)当我写等号(=)时,我希望在符号前后自动插入空格(我必须总是按键盘上的空格插入......).可能吗?
例:
int variable=167;
->
int variable = 167;
Run Code Online (Sandbox Code Playgroud)
要么
"=" -> " = "
Run Code Online (Sandbox Code Playgroud)
2)我希望在括号之前和之后以及逗号之前和之后自动插入空格.可能吗?
例:
void fun(int param1,int param2);
->
void fun ( int param1, int param2 );
Run Code Online (Sandbox Code Playgroud) 有时我需要在 Visual Studio 2012 中隐藏很多显示代码 C++ 的注释。是否可以通过一两次点击来完成?
我有很多文件 - C++中的示例代码.我打开每个文件,我必须在一些项目中将代码从示例文件复制到main.cpp文件.Visual Studio可以在没有项目的情况下编译.cpp中的一个打开文件吗?
我有这个对象:
istringstream ob_stream;
Run Code Online (Sandbox Code Playgroud)
我需要将该对象转换为字符串和char数组才能工作。怎么做?
我正在寻找像Windows的xcode一样好的IDE(xcode是仅具有Mac的最佳自动完成功能的IDE).要求:此IDE必须具有完美的自动完成功能.对于我来说,编辑器具有自动完成功能和非常好的格式化风格.你知道吗?
我有奇怪的问题.我声明了map :: iterator的迭代器,但它不起作用.哪里有问题?
string name "John";
int count = 200;
map<string,int> store;
map<string,int>::iterator it;
it = store.find( name );
if ( it != store.end() )
{
it->second += count;
} else
{
store.insert( make_pair (name, count) );
}
Run Code Online (Sandbox Code Playgroud)