全球彩票平台_全球彩票注册平台|官网下载地址

热门关键词: 全球彩票平台,全球彩票注册平台,全球彩官网下载地址

2晚11点30分写的程序,怎么解决

2018/3/2晚11点30分写的程序(C ),201811点

程序目标:输入一个字符串,竖向输出该字符串。使用string和动态分配内存机制。代码如下:

#include<iostream>
#include "stdafx.h"
#include<cstring>
int main()
{
using namespace std;
string s= cin.getline;
char * a = new char[sizeof(s)];
for (int m = 0;m < sizeof(s);m )
a[m] = s[m];
全球彩票注册平台,for (int n = 0;n < sizeof(s);n )
cout << a[n] << endl;
delete[] a;
cin.get();
cin.get();
return 0;
}

编译器:Visual Studio 2015 

显示编译错误,但是不知道怎么修改。先记录在这。希望大神不吝赐教。

错误信息:

严重性 代码 说明 项目 文件 行 禁止显示状态
错误 C2146 语法错误: 缺少“;”(在标识符“s”的前面) MyProject_001 c:usersadministratordocumentsvisual studio 2015projectsmyproject_01myproject_001myproject_001myproject_001.cpp 10
错误 C2065 “s”: 未声明的标识符 MyProject_001 c:usersadministratordocumentsvisual studio 2015projectsmyproject_01myproject_001myproject_001myproject_001.cpp 10
错误 C2065 “cin”: 未声明的标识符 MyProject_001 c:usersadministratordocumentsvisual studio 2015projectsmyproject_01myproject_001myproject_001myproject_001.cpp 10
错误 C2228 “.getline”的左边必须有类/结构/联合 MyProject_001 c:usersadministratordocumentsvisual studio 2015projectsmyproject_01myproject_001myproject_001myproject_001.cpp 10
错误 C2065 “s”: 未声明的标识符 MyProject_001 c:usersadministratordocumentsvisual studio 2015projectsmyproject_01myproject_001myproject_001myproject_001.cpp 11
错误 C2065 “s”: 未声明的标识符 MyProject_001 c:usersadministratordocumentsvisual studio 2015projectsmyproject_01myproject_001myproject_001myproject_001.cpp 12
错误 C2065 “s”: 未声明的标识符 MyProject_001 c:usersadministratordocumentsvisual studio 2015projectsmyproject_01myproject_001myproject_001myproject_001.cpp 13
错误 C2065 “s”: 未声明的标识符 MyProject_001 c:usersadministratordocumentsvisual studio 2015projectsmyproject_01myproject_001myproject_001myproject_001.cpp 14
错误 C2065 “cout”: 未声明的标识符 MyProject_001 c:usersadministratordocumentsvisual studio 2015projectsmyproject_01myproject_001myproject_001myproject_001.cpp 15
错误 C2065 “endl”: 未声明的标识符 MyProject_001 c:usersadministratordocumentsvisual studio 2015projectsmyproject_01myproject_001myproject_001myproject_001.cpp 15
错误 C2065 “cin”: 未声明的标识符 MyProject_001 c:usersadministratordocumentsvisual studio 2015projectsmyproject_01myproject_001myproject_001myproject_001.cpp 17
错误 C2228 “.get”的左边必须有类/结构/联合 MyProject_001 c:usersadministratordocumentsvisual studio 2015projectsmyproject_01myproject_001myproject_001myproject_001.cpp 17
错误 C2065 “cin”: 未声明的标识符 MyProject_001 c:usersadministratordocumentsvisual studio 2015projectsmyproject_01myproject_001myproject_001myproject_001.cpp 18
错误 C2228 “.get”的左边必须有类/结构/联合 MyProject_001 c:usersadministratordocumentsvisual studio 2015projectsmyproject_01myproject_001myproject_001myproject_001.cpp 18

####希望用一个错误来开始我的博客园之旅,只有不停的纠错,才能提高####

程序目标:输入一个字符串,竖向输出该字符串。使用string和动态分配内存机制。代码如下: #incl...

程序目标:输入一个字符串,竖向输出该字符串。使用string和动态分配内存机制。代码如下:

报错内容:
c:userslibingdocumentsvisual studio 2010projectsceshi1ceshi1123.cpp: error C2065: “printf(“sum”: 未声明的标识符
1>c:userslibingdocumentsvisual studio 2010projectsceshi1ceshi1123.cpp: error C2146: 语法错误: 缺少“;”(在标识符“is”的前面)
1>c:userslibingdocumentsvisual studio 2010projectsceshi1ceshi1123.cpp: error C2065: “is”: 未声明的标识符
1>c:userslibingdocumentsvisual studio 2010projectsceshi1ceshi1123.cpp: error C2017: 非法的转义序列
1>c:userslibingdocumentsvisual studio 2010projectsceshi1ceshi1123.cpp: error C2065: “d”: 未声明的标识符
1>c:userslibingdocumentsvisual studio 2010projectsceshi1ceshi1123.cpp: error C2146: 语法错误: 缺少“;”(在标识符“n””的前面)
1>c:userslibingdocumentsvisual studio 2010projectsceshi1ceshi1123.cpp: error C2065: “n””: 未声明的标识符
1>c:userslibingdocumentsvisual studio 2010projectsceshi1ceshi1123.cpp: error C2065: “sum)”: 未声明的标识符

VS2017出现error C2062: 意外的类型“char”怎么解决?
总而言之就是我的字符型指针定义不了。。
1.我的代码出现了以下问题,网上冲浪也没能解决这个问题。求助
2.错误类型
1>------ 已启动生成: 项目: 字符串处理库, 配置: Debug Win32 ------
1>字符串处理库.cpp
1>c:users57157desktopprogramdesignvs数据封装结构体习题自打字符串处理库字符串处理库字符串处理库.cpp: error C2062: 意外的类型“char”
1>c:users57157desktopprogramdesignvs数据封装结构体习题自打字符串处理库字符串处理库字符串处理库.cpp: error C2065: “src”: 未声明的标识符
1>c:users57157desktopprogramdesignvs数据封装结构体习题自打字符串处理库字符串处理库字符串处理库.cpp: error C2065: “src”: 未声明的标识符
1>c:users57157desktopprogramdesignvs数据封装结构体习题自打字符串处理库字符串处理库字符串处理库.cpp: error C2065: “src”: 未声明的标识符
1>c:users57157desktopprogramdesignvs数据封装结构体习题自打字符串处理库字符串处理库字符串处理库.cpp: error C2065: “src”: 未声明的标识符
1>c:users57157desktopprogramdesignvs数据封装结构体习题自打字符串处理库字符串处理库字符串处理库.cpp: error C2065: “src”: 未声明的标识符
1>c:users57157desktopprogramdesignvs数据封装结构体习题自打字符串处理库字符串处理库字符串处理库.cpp: error C2065: “src”: 未声明的标识符
1>c:users57157desktopprogramdesignvs数据封装结构体习题自打字符串处理库字符串处理库字符串处理库.cpp: error C2065: “src”: 未声明的标识符
1>c:users57157desktopprogramdesignvs数据封装结构体习题自打字符串处理库字符串处理库字符串处理库.cpp: error C2065: “src”: 未声明的标识符
1>已完成生成项目“字符串处理库.vcxproj”的操作 - 失败。
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
3.代码
#include "pch.h"
#include
using namespace std;
int main()
{
char *des, char *src; int len;
cout << "请输入2个字符串";
cin >> des >> src;
cout << "复制前des"< cout stringCopy;//将src的内容复制到des中
cout cout cout cin >> des >> src >> len;
cout << "复制前des" << des;
cout << "复制前src" << src;
stringNCopy(des, src, len);//将src的前n个字符复制到des中
cout << "复制后des" << des;
cout << "复制后src" << src;

以下异或加密代码提示一个奇怪的问题,数字上的错误后缀
void EncryptXOR (long s[8])
{
char key[4] = { 'mque' };
int a[4],b[4];
for (int i= 0; i<= 3; i )
{
a[i] = int(s[2i 1] * 16 s[2i]);
}
for (int j = 0; j <= 3; j )
{
b[j] = a[3-j] ^int;
printf("%c", toascii;
}
}

编译器:Visual Studio 2015

VS2010编写C语言程序时报错error C2065,如何解决;
#include

}

提示错误:
1>c:usershaotingdocumentsvisual studio 2013projectsconvertconvertconvert.cpp: error C2059: 语法错误:“数字上的错误后缀”
1>c:usershaotingdocumentsvisual studio 2013projectsconvertconvertconvert.cpp: error C2146: 语法错误: 缺少“]”(在标识符“i”的前面)
1>c:usershaotingdocumentsvisual studio 2013projectsconvertconvertconvert.cpp: error C2059: 语法错误:“)”

本文由全球彩票平台发布于全球彩票注册平台编程,转载请注明出处:2晚11点30分写的程序,怎么解决

TAG标签: 全球彩票平台
Ctrl+D 将本页面保存为书签,全面了解最新资讯,方便快捷。