腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
2
回答
从
int8_t
数组
创建
std
::
string
c++
、
casting
、
char
、
integer
、
stdstring
在一些代码中,使用
int8_t
[]类型代替char[]。
int8_t
title[256] = {'a', 'e', 'w', 's'};
std
::
string
s(title); // compile error: no corresponding constructor如何正确安全地
创建
std
::
string
?
浏览 62
提问于2021-11-23
得票数 1
回答已采纳
2
回答
将
int8_t
转换为int,这样我就可以对它执行操作。
c++
、
char
、
int
我正在编写一段代码,它必须对
int8_t
数组
执行一系列操作,其中每个元素都存储了一个数字,
从
0到255不等。int y[4]; y[i] = v[i]*3; } 我正在寻找的是一种使用
int8_t
数组
进行操作的方法,或者最好是一种将
int8_t
转换为int的方法(我有一段与int输入一起工作的大代码,将
int8_t
转换为int,然后将其交给我的代码将比将每个int更改为
浏览 5
提问于2014-04-09
得票数 1
回答已采纳
2
回答
从
map c++返回结构的问题
c++
、
struct
、
mapping
struct student
std
::
string
name; uint8_t age;uint8_t year; student makestudent(
std
::
string
m_name,
std
::
string
m_surname, uint8_t m_age::vector<
int8_t
>
浏览 6
提问于2022-09-19
得票数 0
4
回答
如何将const
std
::shared_ptr插入
std
::map
c++
、
c++11
、
rvalue-reference
std
::shared_ptr<const
std
::
string
> ConstDataTypePtr; m_nameToType.insert(
std
::make_pair<
std
::
string
, ConstDataTypePtr
浏览 6
提问于2016-04-19
得票数 0
回答已采纳
3
回答
C++为什么数值限制不适用于uint8_t和
int8_t
?
c++
、
numeric-limits
最近我注意到numeric_limits::max()和numeric_limits::min()似乎不适用于uint8_t和
int8_t
,这是有原因的还是可能是一个bug?
std
::cout << "numeric_limits<
int8_t
>::max() = " << numeric_limits<
int8_t
>::max() <<
std
::endl;
std
::cout <<
浏览 4
提问于2020-06-16
得票数 1
回答已采纳
1
回答
有没有有效的方法来“洗牌”向量?
c++
、
algorithm
、
data-structures
我有一个大的未排序
数组
,每个元素包含一个唯一的整数,
std
::vector<size_t> Vec= {1, 5, 3, 7, 18...}
浏览 4
提问于2018-01-09
得票数 3
2
回答
C++
std
::
string
length()或size()不适用于方法参数
c++
、
macos
、
stdstring
我有一个
从
文件路径
创建
MatLab
数组
名称并将其作为
std
::
string
返回的方法。生成的字符串被传递给另一个方法,该方法将名称写入文件。我的代码: // Assume dataStream is setup correctly // Get arrayName from File UR
浏览 2
提问于2012-11-16
得票数 0
回答已采纳
2
回答
将
std
::vector<bool>添加到容器的变体中
c++
、
boost
、
c++98
我包装了一个C接口,它有一个返回Value*对象的load函数,该对象指向Value对象的动态
数组
: union { int32_t i32; bool b;} Value_T;typedef boost::variant<
std</em
浏览 3
提问于2013-05-22
得票数 2
回答已采纳
2
回答
C++中的Huffman压缩机
c++
、
console
、
compression
(const char *arg1);
std
::vector<= argv[2];
std
::vector<
int8_t
> encoded_data = file_
浏览 0
提问于2016-12-02
得票数 4
回答已采纳
2
回答
从
std
::
string
转换为uint8
c++
、
stdstring
参考这里提供的漂亮解决方案,,(尝试解析任何大于1位的数字-如10 -失败) 有什么想法吗
浏览 1
提问于2012-03-07
得票数 0
回答已采纳
1
回答
避免虚拟模板函数
c++
、
templates
、
factory
、
virtual-functions
我想要
创建
一个“工厂”函数
数组
,它可以用来根据名称实例化派生类(例如,基于命令行参数)。
浏览 4
提问于2017-01-12
得票数 1
4
回答
C++偶数或奇数程序不能正常工作
c++
我是C++新手,我正在做下面的练习: #include "stdafx.h"{ <em
浏览 4
提问于2016-04-20
得票数 0
回答已采纳
2
回答
数据类型大小-想知道一篇好文章
c
static union char int8_t_incorrect[sizeof(
int8_t
) == 1];};我尝试了一个小程序:typedef unsigned short int16_t; char int8_incorrect[siz
浏览 3
提问于2012-02-27
得票数 1
回答已采纳
1
回答
Char到
int8_t
的转换会带来意想不到的结果吗?
c++
、
char
、
type-conversion
、
byte
、
uint8t
为什么将char转换为
int8_t
总是给我字母(char)表示而不是数字值?
std
::cout << "Casting '" << a << "' (char) to (
int8_t
): " << (
int8_t
)a << '\n';
std
::cout(
浏览 3
提问于2019-11-25
得票数 0
回答已采纳
1
回答
for-loop-copy vs
std
::copy中的Bug,我不明白
c++
、
for-loop
、
iterator
、
fifo
下面是一个用于串行输出接口的非常简单(
从
大部分模板代码中去掉)的fifo缓冲区。of bytes)
int8_t
i = reserve(n);
int8_t
j =
std
::min(n, headroom(i)(v.cbegin(),v.size()); } bool put(
std
::basic_
string
<char> v) { return put(v.cbegin(),v.size());
浏览 22
提问于2021-10-07
得票数 0
回答已采纳
1
回答
从
原始内存中重新分配reinterpret_cast获取的指针是否会导致UB?
c++
、
pointers
、
language-lawyer
、
undefined-behavior
、
reinterpret-cast
在我们的讲座中,我们讨论了
std
::list的内部可能实现。讲师展示了
创建
虚拟节点以指示列表末尾的方法: Node* dummy = reinterpret_cast<Node*>(new
int8
浏览 12
提问于2022-01-27
得票数 3
回答已采纳
2
回答
使用Objective-C包装器快速调用C++文件-传递Int值
c++
、
ios
、
objective-c
、
swift
我正在尝试
从
Swift项目中调用c++方法。我使用教程来设置和获取字符串值,效果很好。 } return&title, const
std
::
int8_t
&variable): m_title(title),
浏览 3
提问于2016-08-09
得票数 4
1
回答
C++11中具有对齐元素的
std
::
数组
类型
c++
、
c++11
我想知道使用现代C++11定义
std
::array类型的最好方法是使用内存对齐的附加功能。我知道alignas不能与类型别名一起使用,但这就是我尝试做的精神: template<class T,
std
::size_t N,
std
::size_t A> using AlignedArray= alignas(A)
std
::array<T, N>; 它可以像这样实例化: AlignedArray<
int8_t
, 4, 32> MyArray; 我能想到的最好的工作版本
浏览 10
提问于2019-01-12
得票数 0
回答已采纳
2
回答
C++ -包含3个元素的列表的类
c++
、
class
我试图
创建
一个基本上是关联
数组
/映射的数据类型,但它将有3个元素而不是2个元素。我知道如何基本上为每个数字
创建
一个类,并为每个数字
创建
一个具有适当属性的单独实例,但我觉得这将是相当低效的,因为我可以只有每个数字及其相关属性的列表。 在
创建
这个类方面,我几乎一无所获。
浏览 1
提问于2017-03-26
得票数 1
2
回答
从
字符串写入二进制数据
c++
、
fwrite
我想
创建
一个文件并将"A“写入其中(ascii是65 == 01000001)。奇怪的是,无论
std
::
string
binary的值是多少,myfile.txt中总是有字母P。
std
::
string
binary = "01000001"; FILE* f; f = fopen(file.c_str
浏览 5
提问于2017-01-13
得票数 1
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
这几个C+的坑,一旦踩中了,加班是肯定避免不了了!
boost:asio中的buffer与streambuf简介
字符串分割—istringstream(C+)
字符串的输入
智能指针:让C+程序更加安全和高效的神器
热门
标签
更多标签
活动推荐
运营活动
广告
关闭
领券