任何人都可以告诉c ++中动态强制转换的确切含义.我们在哪里可以使用这种动态铸造?这是在采访中向我询问的,我对这个问题一无所知:).
我有一个文本文件,其中包含:
Cycle code
Cycle month
Cycle year
Event type ID
Event ID
Network start time
Run Code Online (Sandbox Code Playgroud)
我想改变这个文本,以便当有空间时,我想用一个替换它_.之后,我希望字符小写字母如下:
cycle_code
cycle_month
cycle_year
event_type_id
event_id
network_start_time
Run Code Online (Sandbox Code Playgroud)
我怎么能做到这一点?
下面这两者有什么区别:
typedef void (*my_destructor)(void *);
typedef void (*my_destructor)(void *) my_func_ptr;
Run Code Online (Sandbox Code Playgroud)
第二个有效吗?
我正在尝试构建一个块,我收到此错误消息
pprbc_CONTENT_icverification_act.c", line 99.2: 1506-018 (S) Operand of indirection operator must be a pointer expression
任何人都可以解释这意味着什么?
代码如下:
*(WORK_migration_ind_f) =
*(migration_status_in_MI9_CIRCLE_INFO(WORK_source_circle_f));
Run Code Online (Sandbox Code Playgroud) HI,
在unix中,我的目录中有多个文件.我想将所有文件更改为零字节文件.这可能在一个命令行上?
例如:
-rw-r--r-- 1 sumanma dev 434 Jan 8 14:36 pprbc_NL.cpp
-rw-r--r-- 1 sumanma dev 488 Jan 8 14:37 pprbc_TreeBuild.cpp
-rw-r--r-- 1 sumanma dev 783 Jan 8 14:37 pprbc_UPDwm.cpp
Run Code Online (Sandbox Code Playgroud)
我想改变这些
-rw-r--r-- 1 sumanma dev 0 Jan 8 14:36 pprbc_NL.cpp
-rw-r--r-- 1 sumanma dev 0 Jan 8 14:37 pprbc_TreeBuild.cpp
-rw-r--r-- 1 sumanma dev 0 Jan 8 14:37 pprbc_UPDwm.cpp
Run Code Online (Sandbox Code Playgroud)
我在用 tcsh
嗨,我开始学习C++ STL,我只是尝试一些小程序.其中一个是下面的:
inline int const& max (int const& a, int const& b)
{
return a < b ? b : a;
}
template <typename T>
inline T const& max (T const& a, T const& b)
{
return a < b ? b : a;
}
int main()
{
::max(7, 42); // calls the nontemplate for two ints
::max<>(7, 42); // calls max<int> (by argument deduction)
::max('a', 42.7); // calls the nontemplate for two ints
}
Run Code Online (Sandbox Code Playgroud)
我有一些基本的问题!!
为什么在这里使用示波器分辨率算子?
为什么/如何调用:: max <>(7,42)将假定传递的参数是 …
我是c ++模板的新手.我正在尝试一些小程序.
CPP [80]> cat 000001.cpp 000001.hpp
#include <iostream>
#include <string>
#include "000001.hpp"
int main()
{
int i = 42;
std::cout << "max(7,i): " << ::max(7,i) << std::endl;
double f1 = 3.4;
double f2 = -6.7;
std::cout << "max(f1,f2): " << ::max(f1,f2) << std::endl;
std::string s1 = "mathematics";
std::string s2 = "math";
std::cout << "max(s1,s2): " << ::max(s1,s2) << std::endl;
}
template <typename T>
inline T const& max (T const& a, T const& b)
{
return a < b ? …Run Code Online (Sandbox Code Playgroud) 任何人都可以解释我这个说法!
pin.sin_addr.s_addr = ((struct in_addr *)(hp->h_addr))->s_addr;
Run Code Online (Sandbox Code Playgroud) 如果我在UNIX上有一个进程,如果我想在后台运行它,即使我关闭我的终端,我需要它在后台运行,直到它完成.
我该怎么做?
这是一个面试问题:我们如何存储让我们说三个完全独立的不同类的对象.
我的回答是: 创建一个存储所有void指针的数组.喜欢 :
void *array[];
Run Code Online (Sandbox Code Playgroud)
并存储所有对象的指针.数组元素可以很多.但是为了检索元素,我说我们可以使用动态模型或静态模型!我认为这是错误的答案.我认为dynamic cast并且static cast应该在依赖的类中使用.如果我错了,请纠正我.
如果动态强制转换和静态强制转换不起作用reinterpret cast.我们可以使用.
但这是完成这项任务的正确方法吗?
我怎么能在vi编辑器的所有行的开头添加一些像'ABC'的文字?这不起作用!
%s/^/^ABC
Run Code Online (Sandbox Code Playgroud)
我知道这个命令用于替换文本
%s/vggv/uggv/g
Run Code Online (Sandbox Code Playgroud) 我有一个数组,其中包含大数字和小数字.我从WireShark运行日志后得到了它.
这就是数组的外观(对于字节发送):
@Array=qw(10912980
10924534
10913356
10910304
10920426
10900658
10911266
10912088
10928972
10914718
10920770
10897774
10934258
10882186
10874126
8531
8217
3876
8147
8019
68157
3432
3350
3338
3280
3280
7845
7869
3072
3002
2828
8397
1328
1280
1240
1194
1193
1192
1194
6440
1148
1218
4236
1161
1100
1102
1148
1172
6305
1010
5437
3534
4623
4669
3617
4234
959
1121
1121
1075
3122
3076
1020
3030
628
2938
2938
1611
1611
1541
1541
1541
1541
1541
1541
1541
1541
1541 …Run Code Online (Sandbox Code Playgroud)