C 的间接水平与众不同
c++ differs in levels of indirection from
我在尝试编译时收到了此错误消息:
-
错误c2556:'int *gent(const binaryBuffer&,const engryptightekekey&(':Overloaded函数仅通过'BinaryBuffer Encrypt(const binarybuffer&const binarybuffer&const const encryptionkeykeykey& amp; amp; amp; amp;('
-
错误c2040:'encrypt':'int *(const binaryBuffer&,const engryptightekekey&('间接水平与'binarybuffer(const binarybuffer&amp&amp&amp&amp const const encyptionKey&('
-
错误c2556:'char *decrypt(const binaryBuffer&,const engryptightekekey&(':Overloaded函数仅通过'BinaryBuffer decrypt(const binaryBuffer&const binarybuffer&const const const fencryptionkeykeykey& amp; amp; amp;('
-
错误c2040:'解密':'char *(const binaryBuffer&,const engryptionKey&('间接级别与'binarybuffer(const binarybuffer&amp&amp&amp&amp&amp const const encyptionKey&('
CPP文件:
#include "Encryption.h"
#include <algorithm>
#include <iterator>
#pragma intrinsic(_rotl8, _rotr8)
constexpr auto xorKeyLocation = 0;
constexpr auto numberOfBitsToRotateLocation = 1;
int* Encrypt(const BinaryBuffer& plainText, const EncryptionKey& key)
{
const auto xorKey = key[xorKeyLocation];
const auto numberOfBitsToRotate() = key[numberOfBitsToRotateLocation];
const BinaryBuffer result;
do
{
std::transform(
plainText.begin(),
plainText.end(),
std::back_inserter(result),
[&](const auto byte)
{
const auto xored = byte ^ xorKey;
const auto shifted = _rotl8(xored, numberOfBitsToRotate);
return shifted;
});
} while (0);
return result;
}
char* Decrypt(const BinaryBuffer& cipherText, const EncryptionKey& key)
{
const auto xorKey = key[xorKeyLocation];
const auto numberOfBitsToRotate() = key[(std::vector<int>)numberOfBitsToRotateLocation];
const BinaryBuffer result;
std::transform(
cipherText.cbegin(),
cipherText.cend(),
std::back_inserter(result),
[&](const auto byte)
{
const auto shifted = _rotr8(byte, numberOfBitsToRotate);
const auto xored = shifted ^ xorKey;
return xored;
});
return result;
}
h文件:
#pragma once
#include "Common.h"
BinaryBuffer Encrypt(const BinaryBuffer& plainText, const EncryptionKey& key);
BinaryBuffer Decrypt(const BinaryBuffer& cipherText, const EncryptionKey& key);
我在做什么错?
谢谢。
函数的返回类型与标题中的声明不符。
- QTableView:endMoveRows在模型中重置水平页眉大小
- QScrollArea:由垂直滚动条引起的水平滚动条
- 通过水平滚动条更改标签
- 是什么让一些命名函数/运算符与众不同?
- 如何在c ++中以一行(水平)打印两个文件的数据?如给定的.这两种形式来自两个不同的文本文件
- O2优化水平中断程序工作
- 在 SDL 中水平减小静态图像进度条
- 在高通六边形处理器的word32上执行水平求和的最快方法是什么
- 水平排列 QMenu 项目
- 将水平滚动条添加到控制台
- QListWidget 水平滚动条会导致选择消失在视野之外
- 如何在可滚动的 QTableWidget 中有一个冻结的水平标题?
- 为什么GCC/Clang甚至在最高优化水平上也不会内联
- 如何水平排列程序的打印输出循环而不重复
- 如何将QTableView的水平标题设置为默认顺序?
- 在垂直和水平上缩放GTKMM小部件
- C 的间接水平与众不同
- Mac上的QT:形式布局无法水平伸展
- 高于平均水平的数字[C ]
- 改进 AVX 中的非水平分配