用VC6调C代码时的一些问题

单步进入一些函数,随便如strcmp,就会弹出浏览路径,估计是只是编好的lib没有源码?
还有
void kq_free_list(struct kq_person* head)
{
struct kq_person* p=NULL,*q=NULL;
p=head->next;
free(head);
while(p!=NULL)
{
q=p;
p=p->next;
free(q);
}
}
这样没问题,可是直接free(p)就不行,奇怪。
 
直接看代码
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
#include <string.h>
   void main (void)
{
char str1[20];
 
do {
printf ( "Enter a string : " );
gets ( str1 );
} while ( strcmp( str1,"n" ) && strcmp( str1, "\n\r") );
}
据官方文档说,若输入ctrl+z将会终止该无限循环,因为ctrl+z是MSDOS文件的终止符号,但是若改为二进制输入则不被认为是文件终止符(即注释内的部份)。
To work around this problem, change the translation mode of STDIN from text 
mode to binary mode. Because the ^Z character is not translated as an end-
of-file character in binary mode, the gets() from the following example 
accepts input only following a ^Z from STDIN after the translation.
 
To work around this problem, change the translation mode of STDIN from text 
mode to binary mode. Because the ^Z character is not translated as an end-
of-file character in binary mode, the gets() from the following example 
accepts input only following a ^Z from STDIN after the translation.
但关键是VC里即使输入了ctrol+z也不会结束,奇了。
3 shift+control+F2是清marker

转载于:https://www.cnblogs.com/yurius/archive/2013/02/24/2924162.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值