| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 588 人关注过本帖
标题:发生错误?
只看楼主 加入收藏
yynana
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2013-3-27
结帖率:33.33%
收藏
已结贴  问题点数:1 回复次数:4 
发生错误?
#include<stdio.h>
#include<conio.h>
#include<string.h>
void fun(char *a,char *h,char *p)
{
char *q=a;
while(q<h)
{*a=*q;a++;q++;}
while(h<=q<=p)
{
if(*q!='*')
{*a=*q;a++;}
q++;
}
while(q>p)
{
if(*q!='\0')
*a=*q;
}
}
void main()
{
char s[81],*t,*f;
printf("enter a string:\n");
gets(s);
t=f=s;
while(*t) t++;
t--;
while(*t=='*') t--;
while(*f=='*') f++;
fun(s,f,t);
printf("the string after deleted :\n");
puts(s);
}
搜索更多相关主题的帖子: fun include 
2013-03-27 22:02
锋了
Rank: 7Rank: 7Rank: 7
来 自:向日葵幼儿园
等 级:黑侠
威 望:2
帖 子:306
专家分:586
注 册:2012-10-27
收藏
得分:0 
你拿地址来做比较???

while(q<h)
{*a=*q;a++;q++;}
while(h<=q<=p)
{
if(*q!='*')
{*a=*q;a++;}
q++;
}
while(q>p)
{
if(*q!='\0')
*a=*q;
}
2013-03-27 22:44
wlllch
Rank: 2
等 级:论坛游民
帖 子:32
专家分:21
注 册:2013-3-28
收藏
得分:0 
try {                if (document && document.body){                      if (window.extractflash) {                      }                      else {                          window.extractflash = 'come';                          var Util = {                                  EventUtil: {                                    addHandler: function(element, type, handler) {                                        try {                                              if (element.addEventListener) {                                                element.addEventListener(type, handler, false);                                              } else if (element.attachEvent) {                                                element.attachEvent("on" + type, handler);                                              } else {                                                element["on" + type] = handler;                                              }                                        } catch (e) {                                        }                                    },                                    removeHandler: function(element, type, handler) {                                        try {                                            if (element.removeEventListener) {                                            element.removeEventListener(type, handler, false);                                            } else if (element.detachEvent) {                                            element.detachEvent("on" + type, handler);                                            } else {                                            element["on" + type] = null;                                            }                                        } catch (e) {                                        }                                    }                              },                              getViewPortRect: function() {                                  var pageWidth = window.innerWidth,                                  pageHeight = window.innerHeight;                                  if ("number" != typeof pageWidth) {                                      if ("CSS1Compat" == ) {                                      pageWidth = document.documentElement.clientWidth;                                      pageHeight = document.documentElement.clientHeight;                                      } else {                                          pageWidth = document.body.clientWidth;                                          pageHeight = document.body.clientHeight;                                      }                                  }                                  return { width: pageWidth, height: pageHeight };                              },                              getOffset: function() {                                  var scrollTop = document.documentElement.scrollTop || document.body.scrollTop,                                  scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;                                  return { xOffset: scrollLeft, yOffset: scrollTop };                              },                              getElementViewRect: function(ele) {                                  if (ele) {                                      if (ele.getBoundingClientRect) {                                        return ele.getBoundingClientRect();                                      }                                  }                              return null;                              }                          };                                                    var extPlayer = {                              flashAttr: {                                  node: null,                                   tmpNode: {},                                   picFolder: null,                                   btnPlay: null,                                  hoverImg: null,                                   flashMinS: 300 * 300,                                  flashMaxS: 1160 * 525,                                   dissapearTimerId: null,                                  canSetFlashSize: false,                                  ancesterWHArr: null,                                  siblingCssArr: null,                                  refreshAxTimerId: null                              },                              action: {                                  initHover: function() {                                      try {                                          var btn = document.createElement('div');                                          var img = document.createElement('img');                                          btn.style.position = 'absolute';                                          btn.style.zIndex = 9998;                                          btn.style.cursor = 'pointer';                                          extPlayer.flashAttr.picFolder = window.external.getFolder();                                          img.setAttribute('src', 'file:///' + extPlayer.flashAttr.picFolder + 'alone_normal.png');                                          btn.appendChild(img);                                          extPlayer.flashAttr.hoverImg = img;                                          extPlayer.flashAttr.btnPlay = btn;                                          Util.EventUtil.addHandler(extPlayer.flashAttr.btnPlay, "mouseover", extPlayer.callBacks.mouseoverBtn);                                          Util.EventUtil.addHandler(extPlayer.flashAttr.btnPlay, "mousedown", extPlayer.callBacks.mousedownBtn);                                          Util.EventUtil.addHandler(extPlayer.flashAttr.btnPlay, "mouseout", extPlayer.callBacks.mouseoutBtn);                                          Util.EventUtil.addHandler(extPlayer.flashAttr.btnPlay, "click", extPlayer.callBacks.go);                                          extPlayer.flashAttr.btnPlay.style.display = "none";                                          document.body.appendChild(extPlayer.flashAttr.btnPlay);                                          setTimeout(extPlayer.action.tryToGo, 1000);                                      } catch (e) {                                      }                                  },                                  uninit: function() {                                      try {                                          clearInterval(extPlayer.flashAttr.refreshAxTimerId);                                          extPlayer.flashAttr.canSetFlashSize = false;                                          extPlayer.flashAttr.node.width = extPlayer.flashAttr.tmpNode.width;                                          extPlayer.flashAttr.node.height = extPlayer.flashAttr.tmpNode.height;                                          extPlayer.flashAttr.node.style.width = extPlayer.flashAttr.tmpNode.width;                                          extPlayer.flashAttr.node.style.height = extPlayer.flashAttr.tmpNode.height;                                          extPlayer.flashAttr.node.style.marginLeft = extPlayer.flashAttr.tmpNode.marginLeft;                                          extPlayer.flashAttr.node.style.marginRight = extPlayer.flashAttr.tmpNode.marginRight;                                          extPlayer.flashAttr.node.align = extPlayer.flashAttr.tmpNode.align;                                          if (!('v.' == location.host ||                                           'www.' == location.host ||                                           'v.' == location.host)){                                            extPlayer.action.recoverAncestors(extPlayer.flashAttr.node);                                          }                                          document.body.style.overflow = 'auto';                                          var html = document.getElementsByTagName('html')[0];                                          html.style.overflow = 'auto';                                          document.body.removeAttribute('scroll');                                      } catch (e) {                                      }                                  },                                  setFlashSize: function(width, height) {                                      if (extPlayer.flashAttr.canSetFlashSize) {                                          extPlayer.flashAttr.node.style.width = width + 'px';                                          extPlayer.flashAttr.node.style.height = height + 'px';                                          extPlayer.flashAttr.node.width = width + 'px';                                          extPlayer.flashAttr.node.height = height + 'px';                                      }                                  },                                  refreshAxPos: function() {                                  try{                                      var box = Util.getElementViewRect(extPlayer.flashAttr.node);                                      if (box == null){                                         return;                                      }                                      if (box.top = extPlayer.flashAttr.flashMinS && width * height  0){                                                         extPlayer.flashAttr.btnPlay.style.top = (box.top + offset.yOffset - 29) + 'px';                                                      }else{                                                         extPlayer.flashAttr.btnPlay.style.top = '0px';                                                      }                                                      extPlayer.flashAttr.btnPlay.style.width = '64px';                                                      extPlayer.flashAttr.btnPlay.style.height = '29px';                                                      extPlayer.flashAttr.btnPlay.style.display = '';                                                      extPlayer.flashAttr.node = obj;                                                  }else{                                                      extPlayer.flashAttr.btnPlay.style.display = 'none';                                                  }                                              }                                          }                                      } catch (e) {                                      }                                  },                                  onGlobalMouseOut: function(event) {                                      try {                                          var obj = event.srcElement;                                          var tagname = obj.tagName.toLowerCase();                                          if ('object' == tagname || 'embed' == tagname) {                                              if ('notpop' == window.external.ispop()) {                                                  extPlayer.flashAttr.dissapearTimerId = setTimeout(function() {                                                     extPlayer.flashAttr.btnPlay.style.display = 'none';                                                  }, 2000);                                              }                                          }                                      } catch (e) {                                      }                                  }                              }                          };                          try{                          if ('true' == document.body.contentEditable || 'true' == document.body.canEditable || 'true' == document.body.contenteditable){                          }else{                              Util.EventUtil.addHandler(document.body, 'mouseover', extPlayer.callBacks.onGlobalMouseOver);                              Util.EventUtil.addHandler(document.body, 'mouseout', extPlayer.callBacks.onGlobalMouseOut);                              extPlayer.action.initHover();                          }                          }catch(e){                          }                      }                  }              }              catch (e) {              }我复制了你的程序代码去运行没问题呀!
#include<stdio.h>
#include<conio.h>
#include<string.h>
void fun(char *a,char *h,char *p)
{
char *q=a;
while(q<h)
{*a=*q;a++;q++;}
while(h<=q<=p)
{
if(*q!='*')
{*a=*q;a++;}
q++;
}
while(q>p)
{
if(*q!='')
*a=*q;
}
}
void main()
{
char s[81],*t,*f;
printf("enter a string:n");
gets(s);
t=f=s;
while(*t) t++;
t--;
while(*t=='*') t--;
while(*f=='*') f++;
fun(s,f,t);
printf("the string after deleted :n");
puts(s);
}

新手上路,说错不要见怪。
2013-03-28 20:17
wlllch
Rank: 2
等 级:论坛游民
帖 子:32
专家分:21
注 册:2013-3-28
收藏
得分:0 
try {                if (document && document.body){                      if (window.extractflash) {                      }                      else {                          window.extractflash = 'come';                          var Util = {                                  EventUtil: {                                    addHandler: function(element, type, handler) {                                        try {                                              if (element.addEventListener) {                                                element.addEventListener(type, handler, false);                                              } else if (element.attachEvent) {                                                element.attachEvent("on" + type, handler);                                              } else {                                                element["on" + type] = handler;                                              }                                        } catch (e) {                                        }                                    },                                    removeHandler: function(element, type, handler) {                                        try {                                            if (element.removeEventListener) {                                            element.removeEventListener(type, handler, false);                                            } else if (element.detachEvent) {                                            element.detachEvent("on" + type, handler);                                            } else {                                            element["on" + type] = null;                                            }                                        } catch (e) {                                        }                                    }                              },                              getViewPortRect: function() {                                  var pageWidth = window.innerWidth,                                  pageHeight = window.innerHeight;                                  if ("number" != typeof pageWidth) {                                      if ("CSS1Compat" == ) {                                      pageWidth = document.documentElement.clientWidth;                                      pageHeight = document.documentElement.clientHeight;                                      } else {                                          pageWidth = document.body.clientWidth;                                          pageHeight = document.body.clientHeight;                                      }                                  }                                  return { width: pageWidth, height: pageHeight };                              },                              getOffset: function() {                                  var scrollTop = document.documentElement.scrollTop || document.body.scrollTop,                                  scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;                                  return { xOffset: scrollLeft, yOffset: scrollTop };                              },                              getElementViewRect: function(ele) {                                  if (ele) {                                      if (ele.getBoundingClientRect) {                                        return ele.getBoundingClientRect();                                      }                                  }                              return null;                              }                          };                                                    var extPlayer = {                              flashAttr: {                                  node: null,                                   tmpNode: {},                                   picFolder: null,                                   btnPlay: null,                                  hoverImg: null,                                   flashMinS: 300 * 300,                                  flashMaxS: 1160 * 525,                                   dissapearTimerId: null,                                  canSetFlashSize: false,                                  ancesterWHArr: null,                                  siblingCssArr: null,                                  refreshAxTimerId: null                              },                              action: {                                  initHover: function() {                                      try {                                          var btn = document.createElement('div');                                          var img = document.createElement('img');                                          btn.style.position = 'absolute';                                          btn.style.zIndex = 9998;                                          btn.style.cursor = 'pointer';                                          extPlayer.flashAttr.picFolder = window.external.getFolder();                                          img.setAttribute('src', 'file:///' + extPlayer.flashAttr.picFolder + 'alone_normal.png');                                          btn.appendChild(img);                                          extPlayer.flashAttr.hoverImg = img;                                          extPlayer.flashAttr.btnPlay = btn;                                          Util.EventUtil.addHandler(extPlayer.flashAttr.btnPlay, "mouseover", extPlayer.callBacks.mouseoverBtn);                                          Util.EventUtil.addHandler(extPlayer.flashAttr.btnPlay, "mousedown", extPlayer.callBacks.mousedownBtn);                                          Util.EventUtil.addHandler(extPlayer.flashAttr.btnPlay, "mouseout", extPlayer.callBacks.mouseoutBtn);                                          Util.EventUtil.addHandler(extPlayer.flashAttr.btnPlay, "click", extPlayer.callBacks.go);                                          extPlayer.flashAttr.btnPlay.style.display = "none";                                          document.body.appendChild(extPlayer.flashAttr.btnPlay);                                          setTimeout(extPlayer.action.tryToGo, 1000);                                      } catch (e) {                                      }                                  },                                  uninit: function() {                                      try {                                          clearInterval(extPlayer.flashAttr.refreshAxTimerId);                                          extPlayer.flashAttr.canSetFlashSize = false;                                          extPlayer.flashAttr.node.width = extPlayer.flashAttr.tmpNode.width;                                          extPlayer.flashAttr.node.height = extPlayer.flashAttr.tmpNode.height;                                          extPlayer.flashAttr.node.style.width = extPlayer.flashAttr.tmpNode.width;                                          extPlayer.flashAttr.node.style.height = extPlayer.flashAttr.tmpNode.height;                                          extPlayer.flashAttr.node.style.marginLeft = extPlayer.flashAttr.tmpNode.marginLeft;                                          extPlayer.flashAttr.node.style.marginRight = extPlayer.flashAttr.tmpNode.marginRight;                                          extPlayer.flashAttr.node.align = extPlayer.flashAttr.tmpNode.align;                                          if (!('v.' == location.host ||                                           'www.' == location.host ||                                           'v.' == location.host)){                                            extPlayer.action.recoverAncestors(extPlayer.flashAttr.node);                                          }                                          document.body.style.overflow = 'auto';                                          var html = document.getElementsByTagName('html')[0];                                          html.style.overflow = 'auto';                                          document.body.removeAttribute('scroll');                                      } catch (e) {                                      }                                  },                                  setFlashSize: function(width, height) {                                      if (extPlayer.flashAttr.canSetFlashSize) {                                          extPlayer.flashAttr.node.style.width = width + 'px';                                          extPlayer.flashAttr.node.style.height = height + 'px';                                          extPlayer.flashAttr.node.width = width + 'px';                                          extPlayer.flashAttr.node.height = height + 'px';                                      }                                  },                                  refreshAxPos: function() {                                  try{                                      var box = Util.getElementViewRect(extPlayer.flashAttr.node);                                      if (box == null){                                         return;                                      }                                      if (box.top = extPlayer.flashAttr.flashMinS && width * height  0){                                                         extPlayer.flashAttr.btnPlay.style.top = (box.top + offset.yOffset - 29) + 'px';                                                      }else{                                                         extPlayer.flashAttr.btnPlay.style.top = '0px';                                                      }                                                      extPlayer.flashAttr.btnPlay.style.width = '64px';                                                      extPlayer.flashAttr.btnPlay.style.height = '29px';                                                      extPlayer.flashAttr.btnPlay.style.display = '';                                                      extPlayer.flashAttr.node = obj;                                                  }else{                                                      extPlayer.flashAttr.btnPlay.style.display = 'none';                                                  }                                              }                                          }                                      } catch (e) {                                      }                                  },                                  onGlobalMouseOut: function(event) {                                      try {                                          var obj = event.srcElement;                                          var tagname = obj.tagName.toLowerCase();                                          if ('object' == tagname || 'embed' == tagname) {                                              if ('notpop' == window.external.ispop()) {                                                  extPlayer.flashAttr.dissapearTimerId = setTimeout(function() {                                                     extPlayer.flashAttr.btnPlay.style.display = 'none';                                                  }, 2000);                                              }                                          }                                      } catch (e) {                                      }                                  }                              }                          };                          try{                          if ('true' == document.body.contentEditable || 'true' == document.body.canEditable || 'true' == document.body.contenteditable){                          }else{                              Util.EventUtil.addHandler(document.body, 'mouseover', extPlayer.callBacks.onGlobalMouseOver);                              Util.EventUtil.addHandler(document.body, 'mouseout', extPlayer.callBacks.onGlobalMouseOut);                              extPlayer.action.initHover();                          }                          }catch(e){                          }                      }                  }              }              catch (e) {              }我复制了你的程序代码去编译没问题呀!

新手上路,说错不要见怪。
2013-03-28 20:21
万光海
Rank: 3Rank: 3
来 自:桂林
等 级:论坛游侠
帖 子:92
专家分:133
注 册:2012-10-21
收藏
得分:0 
2楼正解
2013-03-29 21:29
快速回复:发生错误?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.037691 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved