c语言 预编译警告,关于C语言g++ -Wall编译后的警告。。。。

//string reversal using stack

//#include 

//#include 

#include 

#include 

#include 

using namespace std;

void Reverse(char *C,int n)

{

stack  S;

//loop for push

for (int i = 0; i

{

S.push(C[i]);

}

//loop for pop

for (int j = 0; j

{

C[j] = S.top();//overwrite the character at index i

S.pop();

}

}

int main()

{

char C[51];

printf ("Enter a string : ");

gets(C);

Reverse(C,strlen(C));

printf ("Output = %s",C);

printf ("\n");

}

a4b9ead658480b25435fcb7a5adda5b6.png

这几个警告是怎么回事?大神们帮我解析一下啊。。。。。

还有就是代码是不是有问题,Reverse的两个for循环并列关系,应该是同步执行吧,如果是同步执行,那么第二个for循环就错了呀。。。。我感觉有点蒙

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值