c语言字母转化为数字,运行不了,还有怎样才能转化成C++语言

我也推荐C++ Primer
您的举报已经提交成功,我们将尽快处理,谢谢!
谭浩强 编写的 C语言
清华大学出版社出版
这是 全国最权威的 C语言入门教材了!
C程序设计语言(第2版·新版)
《C Primer Plus中文版(第五版)》
都比较好。。。
大家还关注
<a href="/b/.html" target="_blank" class="trackEventQuestion" trackType="PC_问题详细页" trackAction="跳转" trackDes="PC_大家还关注" title="c语言入门级问题,小数和整数引起的问题 我在做初一的方程题时,想用c语言做,做了几个,都出来了。
可下面这个就出不来,不知为什么?
for(x=1;x<=6000;x++)
printf("%lf",x);
改了一下,也可以成功,但不知原因。
for(x=1;xc语言入门级问题,小数和整数引起的问题 ...
(window.slotbydup=window.slotbydup || []).push({
id: '2081942',
container: s,
size: '1000,60',
display: 'inlay-fix'(1)C++语言对C语言做了很多改进_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
(1)C++语言对C语言做了很多改进
上传于||文档简介
&&(&#03;)&#8203;C&#8203;+&#8203;+&#8203;语&#8203;言&#8203;对&#8203;C&#8203;语&#8203;言&#8203;做&#8203;了&#8203;很&#8203;多&#8203;改&#8203;进
阅读已结束,如果下载本文需要使用0下载券
想免费下载更多文档?
下载文档到电脑,查找使用更方便
还剩27页未读,继续阅读
你可能喜欢将c语言注释转换成c++注释
可以分为7种情况
1.一般情况
/* int i = 0; */
2.换行问题
/* int i = 0; */ int j = 0;
3.匹配问题
/int i = 0;/*xxxxx/
4.多行注释问题
int j = 0;
int k = 0;
*/int k = 0;
5.连续注释问题
6.连续的**/问题
7.C++注释问题
// /xxxxxxxxxxxx/
转换之后结果
1.一般情况
// int i = 0;
2.换行问题
// int i = 0;
int j = 0;
3.匹配问题
//int i = 0;/*xxxxx
4.多行注释问题
//int i=0;
//int j = 0;
//int k = 0;
int k = 0;
5.连续注释问题
6.连续的**/问题
7.C++注释问题
// /xxxxxxxxxxxx/
#pragma warning (disable:4996)
typedef enum STATE
//转换成功
FILE_ERROR, //文件错误
NOT_MATCH,
//注释不匹配
//其他错误
typedef enum TAG
TAG_BEDIN,//在c注释段内
//注释结束
STATE AnnotationConvert(FILE* InFile, FILE* OutFile)
TAG tag = TAG_END;
assert(InFile);
assert(OutFile);
firstch = fgetc(InFile);
switch(firstch)
case(&#39;/&#39;):
secondch = fgetc(InFile);
if (secondch == &#39;*&#39;&& tag == TAG_END)
fputc(&#39;/&#39;, OutFile);
fputc(&#39;/&#39;, OutFile);
tag = TAG_BEDIN;
fputc(firstch, OutFile);
fputc(secondch, OutFile);
if (secondch == &#39;/&#39;)
nextch = fgetc(InFile);
fputc(nextch, OutFile);
} while (nextch != &#39;\n&#39; && nextch != EOF);
case(&#39;\n&#39;) :
fputc(firstch, OutFile);
if (tag == TAG_BEDIN)
fputc(&#39;/&#39;, OutFile);
fputc(&#39;/&#39;, OutFile);
case(&#39;*&#39;) :
secondch = fgetc(InFile);
if (secondch == &#39;/&#39;)
char nextch = fgetc(InFile);
tag = TAG_END;
fputc(&#39;\n&#39;, OutFile);
if (nextch == &#39;/&#39;)
fseek(InFile, -1, SEEK_CUR);
else if (nextch != &#39;\n&#39;)
fputc(nextch, OutFile);
fputc(firstch, OutFile);
fseek(InFile, -1, SEEK_CUR);
fputc(firstch, OutFile);
} while (firstch != EOF);
if (tag == TAG_END)
return SUCCEED;
return NOT_MATCH;
int startconvert()
const char* infilename = &input.c&;
const char* outfilename = &output.c&;
FILE* InFile = fopen(infilename, &r&);
FILE* OutFile = fopen(outfilename, &w&);
if (InFile == NULL)
perror(&input.c&);
return FILE_ERROR;
if (OutFile == NULL)
fclose(InFile);
perror(&output.c&);
return FILE_ERROR;
s = AnnotationConvert(InFile, OutFile);
fclose(InFile);
fclose(OutFile);
int main()
STATE ret = startconvert();
if (ret == SUCCEED)
printf(&转换成功\n&);
else if (ret == NOT_MATCH)
printf(&注释不匹配\n&);
else if (ret == FILE_ERROR)
printf(&文件错误:%d\n&, errno);
printf(&其他错误\n&);
getchar();
(window.slotbydup=window.slotbydup || []).push({
id: '2467140',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467141',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467143',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467148',
container: s,
size: '1000,90',
display: 'inlay-fix'c语言有引用吗,c++才有,对吗
[问题点数:20分,结帖人yang_best]
c语言有引用吗,c++才有,对吗
[问题点数:20分,结帖人yang_best]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
本帖子已过去太久远了,不再提供回复功能。后使用快捷导航没有帐号?
美国“程序员世界”无门槛从事编程后,让我最快乐的十件事写代码,更需要设计代码成为优秀程序员的十个有效方法CUnit----C语言的单元测试框架
编程语言最新帖子
分享交流最新帖子
综合技术最新帖子
最新技术问答
最新代码分享
最新交流主题
C语言论坛最新贴子
C++论坛最新帖子
Java论坛最新帖子
友情链接(企鹅93-853-855)&&&&&&&&&&&&&&&&&&
( 粤ICP备号-2 )

我要回帖

更多关于 labview转化为c语言 的文章

 

随机推荐