tensorflow axis1越界

-*- coding: utf-8 -*-

#author JLU_GuanQQ
"""
Spyder Editor

This is a temporary script file.
"""

#step0 import module and generate dataset
import tensorflow as tf
import numpy as np
#import matplotlib.pyplot as plt
BATCH_SIZE=8
seed=2
#generate random numbers based on seed
rdnum=np.random.RandomState(seed)
x_true=rdnum.rand(32,2)
y_true=[[int(x1+x2<1)] for (x1,x2) in x_true]

#step1 define the input parameter output and the process of forward propagation of the network
x=tf.placeholder(tf.float32,shape=(None,2)) #input
y=tf.placeholder(tf.float32,shape=(None,1)) #output
w1=tf.Variable(tf.random_normal([2,3])) #parameter
w2=tf.Variable(tf.random_normal([3,1])) #parameter
a=tf.matmul(x,w1) #propagation
y_=tf.matmul(a,w2) #propagation

#step2 define loss_function and backforward propagation
loss_function=tf.reduce_mean(tf.square(y_-y))
train_step=tf.train.GradientDescentOptimizer(0.001).minimize(loss_function)

#step3 define session and begin to train
with tf.Session() as sess:
init_parameter=tf.global_variables_initializer() #initialize parameters
sess.run(init_parameter)
steps=20000 #define the number of training sessions
for i in range(steps):
start_position=(i*BATCH_SIZE)%32
end_position=start_position+BATCH_SIZE
sess.run(train_step,feed_dict={x:x_true[start_position,end_position],y:y_true[start_position,end_position]})

            最后一句话 index 8 is out of bounds for axis 1 with size 2
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
axis1
生成的WEBSERVICE调用程序编译文件的控件.eclipse开发
axis1的发布
NULL 博文链接:https://kdisk-sina-com.iteye.com/blog/261537
axis1测试
测试。。。。。 :roll:
axis1资料整理
是从网上下载的资源,经修改后,可用来生成webservice客户端和服务端.工程可用,需在本地修改.
axis1 客户端开发
[code=&quot;java&quot;]axis1 客户端调用需要一个调用类,四个jar包,如果web调用需要配置CLASSPATH=.;D:\Program Files\apache-tomcat-6.0.20\lib\axis-1.4.jar;D:\Program Files\apache-tomcat-6.0.20\lib\jaxrpc.jar 和JAVA_HOME package com.ch...
越界!?
这是一个音量控制部分.其中 0 =< t <= 255rnrnprocedure TMainForm.VolumeTrackBarChange(Sender: TObject);0Dnvarrnt,v:longint;rnbeginrn t:=volumeTrackBar.Position;rn v:=(t shl 8) or (t shl 24); //按理说,此处应该不会越界才对,但他偏偏就越界了,怎么回事?比如 t=171 时。rn waveOutSetVolume(0,v);rnend;rn
越界
void swap(int*a,int*b)rnrn*a=*a+*b; printf("%d,%d\n",*a,*b);rn*b=*a-*b; printf("%d,%d\n",*a,*b);rn*a=*a-*b; printf("%d,%d\n",*a,*b);rnrnrnrnint main(int argc, char *argv[])rnrnrn int a=2000000000;rn int b=1000000000;rn swap(&a,&b);rn printf("%d,%d",a,b);rn rnreturn 0;rn
AXIS1[1].2_API.CHM
AXIS1[1].2_API.CHM axis帮助文档
Axis1 创建Webservice 服务端
NULL 博文链接:https://sunshineday328.iteye.com/blog/769486
axis1 server client 程序
NULL 博文链接:https://yanggq930.iteye.com/blog/1549425
Axis1发布webservice服务
Axis1发布webservice服务,demo项目,已包含所需的jar包等各种文件,下载导入即可启动运行,有问题的欢迎咨询哈
Axis1 dev note
Axis1 开发指南,介绍各种开发方法,自己总结的
axis1和2 使用文档
自己收集的 axis1和2 使用文档
AXIS2 和 AXIS1兼容问题
我用AXIS2发布了服务,不知道能否用AIXS1调用。rn请高手指教,如果能的话应该怎么调用?rn我用CALL类试了一下,有问题(CALL是AXIS1的东东吧)rn
axis1 webservice案例
axis1+ webservice案例 内含jar包
axis1调用webservice报错
Unexpected wrapper element execute found. Expected http://was.application/execute.rnrnrn代码如下:rn[code=Java]rnrnrnimport java.io.ByteArrayInputStream;rnimport java.io.ByteArrayOutputStream;rnimport java.io.IOException;rnimport java.rmi.RemoteException;rnimport java.util.zip.GZIPOutputStream;rnrnimport javax.xml.rpc.ServiceException;rnrnimport org.apache.axis.client.Call;rnimport org.apache.axis.client.Service;rnrnpublic class Test rn rn /**rn * 数据GZIP 压缩rn * rn * @param strrn * @returnrn * @throws IOExceptionrn */rn public static String compress(String s) throws IOException rn ByteArrayInputStream input = new ByteArrayInputStream(srn .getBytes("UTF-8"));rn ByteArrayOutputStream output = new ByteArrayOutputStream(1024);rn GZIPOutputStream gzout = new GZIPOutputStream(output);rn byte[] buf = new byte[1024];rn int number;rn while ((number = input.read(buf)) != -1) rn gzout.write(buf, 0, number);rn rn gzout.close();rn input.close();rn String result = new sun.misc.BASE64Encoder().encode(output.toByteArray());rn output.close();rn return result;rn rn public static void main(String[] args) throws ServiceException, RemoteException, IOException rn Service service = new Service();rn String receive_result = "";rn Call call = null;rn String object_key = "W2011112218376";rn String amount = "10.0";rn String json = "orderId:'"+object_key+"',amount:'"+amount+"'";rn call = (Call) service.createCall();rn call.setTargetEndpointAddress("http://115.236.180.114:701/services/wholesaleCheckBalanceWAS?wsdl=IWholesaleCheckBalanceWAS.wsdl");rn call.setOperationName("execute"); rn receive_result = (String)call.invoke(new Object[]"U001",compress(json),"125539"); rn System.out.println(receive_result);rnrn rnrnrnrn[/code]
axis2和axis1不兼容的问题
目前遇到的问题是:服务器1上运行着基于axis2开发的webservice程序,但是目前由于需求方面原因,需要调用另一台服务器2上基于axis1开发的webservice服务,并且新的程序还要部署在服务器1上(即axis2环境下),出现的问题是根据服务器2上的webservice的wsdl文件,用axis2的wsdl2java无法生成客户端;若是用axis1的wsdl2java生成客户端程序,在axis2环境下无法正确运行,请各位高手指点迷津!
axis1部署问题
axis1部署文件server-config.wsdd中有这样一句rn这句话是什么意思,有何用处?rn其路径是个绝对路径,能否改成相对路径?rn谢谢!
axis1和axis2客户端调用方法
1、axis1: Service s=new Service(); Call c=(Call)s.createCall(); c.setTargetEndpointAddress(&quot;http://130.59.10.177:8090/services/WebService&quot;); c.setOperationName(new QName(&quot;http://webservice....
AXIS1全套JAR包
全套AXIS 1 JAR包,不用再去到处找其它分,5分搞定全套,不要错过。
axis1的示例和webservice开发手册
这是个人写的axis1的示例,该示例实现了三个功能:一:传递文件,二:将传递的字符串生成xml文件,还有一个就是用户名和密码验证的功能,另外还有webservice开发手册
Axis1自学笔记续
一、生成webservice服务 二、根据wsdl文件生成客户端
AXIS1 序列化 OMElement对象
小弟遇到一个难题,跪求各位大哥指点。rn由于规范要求,我用AIX1发布的服务的接口参数必须是OMElement对象,这个对象类似于DOM4J的ELEMENT,是AIXS2里的类。 AXIS1序列化不了这个类,就无法接收报文。 怎么样能序列化这个对象呢?
axis1还用吗?
webservice框架很多。 如:xfire, cxf jax-ws axis2 axis1 , 公司里用哪个比较多。 axis1公司还用吗。 rn请不要给官方答案,中立答案
简洁axis1的应用
Axis用过一段时间后就听说Axis2横空出世,继而接触了CXF,如果不赶紧整理,怕是都要遗忘了,今天咱就先整理一下Axis1。 Axis1终于1.4版本,此后转为Axis2。 先搭建一个简单的Axis1,日后根据需要逐步求精。 在开始构建前,我们需要获得以下jar包: 引用 activation.jar axis.jar commons-discovery.jar commons...
axis1开发Web Services入门
用axis1开发Web Services入门,包括axis1插件的安装,环境的配置以及Web Services入门程序。
使用的axis1,想要获取MessageContext
我用axis正常调用了我的发布的webservice。rn我发布成webservice的方法:rnpublic String save(String data,String config)rnrn调用里写了rncall.getMessageContext().setUsername("222");rncall.getMessageContext().setPassword("chen");rnhandler invoke 里有 MessageContext,我可以取到。rn请问在save里怎么获取到。我不想让用户再把username传到我的方法里,感觉多余。rn请问怎么能在save里获取username
axis1实现webservice所需jar包
axis1实现webservice所需jar包 activation.jar axis-ant.jar axis.jar commons-discovery-0.2.jar commons-logging-1.0.4.jar jaxrpc.jar log4j-1.2.8.jar mail.jar saaj.jar wsdl4j-1.5.1.jar xalan.jar xmlsec-1.2.1.jar
Axis1客户端连接超时的设置方法!!!
axis1客户端连接超时设置!!!!
Axis1,Axis2,Xfire,CXF区别
如果你选择了webservice方式对现有的系统进行封装,需要对现有的技术框架进行了解和评估,本文对现有的部分开源webservice框架进行描述对比。
axis1客户端代码生成和服务端部署
wsdl2java工具:java -cp lib\axis.jar;lib\commons-discovery-0.2.jar;lib\commons-logging-1.0.4.jar;lib\jaxrpc.jar;lib\log4j-1.2.8;lib\saaj.jar;lib\wsdl4j-1.5.1.jar;lib\activation-1.1.jar;lib\mail-1.4.jar o...
WebServer 客户端 axis1 相关依赖
WebServer 客户端 axis1 相关依赖 &amp;lt;dependency&amp;gt; &amp;lt;groupId&amp;gt;org.apache.axis&amp;lt;/groupId&amp;gt; &amp;lt;artifactId&amp;gt;axis&amp;lt;/artifactId&amp;gt; &amp;lt;version&amp;gt;1.4&amp;lt;/vers...
WebService框架整理(一) Axis1
NULL 博文链接:https://snowolf.iteye.com/blog/575019
aixs2客户端调axis1服务
axis2 调axis1服务
Axis1 stub方式配置webService
NULL 博文链接:https://yyang1986321.iteye.com/blog/585875
越界问题
[code=C#]using System;rnusing System.Collections.Generic;rnusing System.Text;rnrnnamespace BuggyApprnrn class Programrn rn static void Main(string[] args)rn rn int Columns = Int32.Parse(args[0]);rn int Rows = Int32.Parse(args[1]);rn rn int MyNumber;rn int gotIt = 0;rn string Answer = "yes";rn MyArray a = new MyArray();rn a.BuildMatrix(Columns, Rows);rn //为了测试,在这里打印出数组元素rn for (int i = 0; i < Columns; i++)rn for (int j = 0; j < Rows; j++)rn Console.WriteLine(a.x[i, j]);rn while (Answer == "yes")rn rn Console.Write("Please enter a number between 1 and 100:");rn MyNumber = Int32.Parse(Console.ReadLine());rn for (int i = 0; i < Columns; i++)rn rn for (int j = 0; j < Rows; j++)rn rn if (MyNumber == a.x[i, j])rn rn Console.WriteLine("你猜对了!");rn gotIt = 1;rn break;rn rn rn rn if (gotIt == 0)rn Console.WriteLine("对不起,没有猜对!");rn gotIt = 0;rn Console.WriteLine("还想玩吗?(yes/no)");rn Answer = Console.ReadLine();rn rn rn rn rnrn public class MyArrayrn rn public int[,] x;rn public void BuildMatrix(int columns, int rows)rn rn int j, k = 0;rn x = new int[columns, rows];rn Random randomNumber = new Random();rn for (j = 0; j < columns; j++)rn x[j, k] = randomNumber.Next(1, 100);rn for (k = 0; k < rows; k++)rn x[j, k] = randomNumber.Next(1, 100);rn rn rn[/code]rn好像是x[j, k] = randomNumber.Next(1, 100);rn这句越界了~不知道怎么改~~
关于越界
我用for k=0 to 1rnrstobj.filter="qid="&qnum(i)其中rstobj是一个记录集,我单独执行时没有问题但是我在本程序前面加一个form集的界面时出现下标k越界,请问是何故.rnrn
double类型越界
[code=C/C++][/code]// GibbsEquationSolve.cpp : 定义控制台应用程序的入口点。rn//rnrn#include "stdafx.h"rn#include "Data.h"rn#include rn#include rn#include rn#include rn#include rn#include rnusing namespace std;rnrnconst double PI = 3.14159;rnconst int k = 144;rndouble C;rndouble W; //曲柄角速度rndouble Pr; //抽油杆密度rndouble A; //速度rndouble E; //钢杆弹性模量rndouble Ar; //抽油杆截面积rndouble EA; rndouble p; //液体粘度 rndouble L; //抽油杆长度rndouble Dt;rndouble Dr;rndouble x;rnint iCountT;rnrnvector vecD(DataDArray, DataDArray + 144);rnvector vecU(DataUArray, DataUArray + 144);rnvector vecOutputU;rnvector vecOutputF;rnvector vecT;rnrnvector Param1(11, 0.0);rnvector Param2(11, 0.0);rnvector Param3(11, 0.0);rnvector Param4(11, 0.0);rnrnvector vecA;rnvector vecB;rnvector vecK;rnvector vecP; rnrn/*rndouble Param1[11];rndouble Param2[11];rndouble Param3[11];rndouble Param4[11];rnrndouble vecA[11];rndouble vecB[11];rndouble vecK[11];rndouble vecP[11];rn */rnrnvoid ReadFile()rnrn int i;rn int temp;rn fstream inStream("inputdata.txt", ios::in);rn if (!inStream)rn rn cout << "Error" << endl;rn return;rn rnrn if (!inStream.eof())rn rn inStream >> Dt;rn inStream >> Dr;rn inStream >> Ar;rn inStream >> p;rn inStream >> L;rn inStream >> Pr;rn inStream >> W;rn inStream >> A;rn inStream >> E;rn inStream >> iCountT;rn inStream >> x;rnrn for (i = 0; i != iCountT; ++i)rn rn inStream >> temp;rn vecT.push_back(temp);rn rn rnrn EA = E * Ar;rn inStream.close();rnrnrn//rnvoid WriteFile()rnrn int i;rn ofstream outStreamU("outputdataU.txt", ios::out | ios::app);rn ofstream outStreamF("outputdataF.txt", ios::out | ios::app);rn if (!outStreamU || !outStreamF)rn rn cout << "Error!" << endl;rn return;rn rn/*rn if (vecOutputF.empty() || vecOutputU.empty())rn rn return;rn rn*/rn for (i = 0; i != vecOutputU.size(); ++i)rn rn outStreamF << vecOutputF[i] << '\t';rn outStreamU << vecOutputU[i] << '\t';rn rnrn outStreamF.close();rn outStreamU.close();rnrnrn//Calculate Parameter Crnvoid FuncCalcC()rnrn double m = Dt / Dr;rn double B1 = (pow(m, 2) - 1) / 2 / log(m) - 1;rn double B2 = (pow(m, 4) - 1 - pow((pow(m, 2) - 1), 2)) / log(m);rn C = 2 * PI * p / Pr / Ar * (1 / log(m) + 2 / B2 * (B1 + 1) * (B1 + 2 / rn (W * L / A / sin(W * L / A) + cos(W * L / A))));rnrnrn//Calculate Parameter σrnvoid CalcParam1()rnrn Param1[0] = accumulate(vecD.begin(), vecD.end(), 0) * 2 / k;rn for (int n = 1; n != 11; ++n)rn rn double temp = 0.0;rn for (int p = 1; p != k + 1; ++p)rn rn temp += vecD[p-1] * cos(2 * n * PI * p / k);rn rn Param1[n] = temp * 2 / k;rn rnrnrn//Calculate Parameter τrnvoid CalcParam2()rnrn for (int n = 1; n != 11; ++n)rn rn for (int p = 1; p != k + 1; ++p)rn rn Param2[n] += vecD[p-1] * sin(2 * n * PI * p / k);rn rn Param2[n] = Param2[n] * 2 / k;rn rnrnrn//Calculate Parameter νrnvoid CalcParam3()rnrn Param3[0] = accumulate(vecU.begin(), vecU.end(), 0) * 2 / k;rn for (int n = 1; n != 11; ++n)rn rn for (int p = 1; p != k + 1; ++p)rn rn Param3[n] += vecU[p-1] * cos(2 * n * PI * p / k);rn rn Param3[n] = Param3[n] * 2 / k;rn rnrnrn//Calculate Parameter δrnvoid CalcParam4()rnrn for (int n = 1; n != 11; ++n)rn rn for (int p = 1; p != k + 1; ++p)rn rn Param4[n] += vecD[p-1] * sin(2 * n * PI * p / k);rn rn Param4[n] = Param4[n] * 2 / k;rn rnrnrn//Calculate Parameter αrnvoid CalcParamA()rnrn double tempA = 0.0;rn vecA.push_back(tempA);rn for (int n = 1; n != 11; ++n)rn rn double temp = sqrt(1 + pow(C / n / W, 2));rn tempA = n * W / A / sqrt(2.0) * sqrt(1 + temp);rn vecA.push_back(tempA);rn rnrnrn//Calculate Parameter βrnvoid CalcParamB()rnrn double tempB = 0.0;rn vecB.push_back(tempB);rn for (int n = 1; n != 11; ++n)rn rn double temp = sqrt(1 + pow(C / n / W, 2));rn tempB = n * W / A / sqrt(2.0) * sqrt(-1 + temp);rn vecB.push_back(tempB);rn rnrnrn//Calculate Parameter κand μrnvoid CalcParamKandParamP()rnrn double tempK = 0.0;rn vecK.push_back(tempK);rn double tempP = 0.0;rn vecP.push_back(tempP);rnrn for (int n = 1; n != 11; ++n)rn rn double temp = EA * (pow(vecA[n], 2) + pow(vecB[n], 2));rn tempK = (Param1[n] * vecA[n] + Param2[n] * vecB[n]) / temp;rn vecK.push_back(tempK);rn tempP = (Param1[n] * vecB[n] - Param2[n] * vecA[n]) / temp;rn vecP.push_back(tempP);rn rnrnrn//rndouble FuncQ(const double &x, const int &n)rnrn double temp;rn temp = (vecK[n] * cosh(vecB[n] * x) + Param4[n] * sinh(vecB[n] * x)) * sin(vecA[n] * x) + rn (vecP[n] * cosh(vecB[n] * x) + Param3[n] * cosh(vecB[n] * x)) * cos(vecA[n] * x);rnrn return temp;rnrnrn//rndouble FuncP(const double &x, const int &n)rnrn double temp;rn temp = (vecK[n] * cosh(vecB[n] * x) + Param4[n] * cosh(vecB[n] * x)) * cos(vecA[n] * x) + rn (vecP[n] * cosh(vecB[n] * x) + Param3[n] * sinh(vecB[n] * x)) * sin(vecA[n] * x);rnrn return temp;rnrnrn//rndouble FuncDeriQ(const double &x, const int &n)rnrn double temp;rn temp = ((Param2[n] * sinh(vecB[n] * x) / EA) + (Param4[n] * vecB[n] - Param3[n] * vecA[n]) * cosh(vecB[n] * x)) * sin(vecA[n] * x) +rn ((Param4[n] * cosh(vecB[n] * x) / EA) + (Param3[n] * vecB[n] - Param4[n] * vecA[n]) * sinh(vecB[n] * x)) * cos(vecA[n] * x);rnrn return temp;rnrnrn//rndouble FuncDeriP(const double &x, const int &n)rnrn double temp;rn temp = ((Param2[n] * cosh(vecB[n] * x) / EA) + (Param4[n] * vecB[n] - Param3[n] * vecA[n]) * sinh(vecB[n] * x)) * cos(vecA[n] * x) +rn ((Param1[n] * sinh(vecB[n] * x) / EA) + (Param3[n] * vecB[n] - Param4[n] * vecA[n]) * cosh(vecB[n] * x)) * sin(vecA[n] * x);rnrn return temp;rnrnrn//U(x, t)rnvoid FuncU(const double &x, const vector &vecT)rnrn for (int i = 0; i != vecT.size(); ++i)rn rn double temp = 0.0;rn double temp2;rn for (int n = 1; n != 11; ++n)rn rn temp += FuncQ(x, n) * cos(n * W * vecT[i]) + FuncP(x, n) * sin(n * W * vecT[i]);rn rn temp2 = Param1[0] / (2 * EA) * x + Param3[0] / 2 + temp; rn vecOutputU.push_back(temp2);rn rnrnrn//F(x, t)rnvoid FuncF(const double &x, const vector &vecT)rnrn for (int i = 0; i != vecT.size(); ++i)rn rn double temp = 0.0;rn double temp2;rn for (int n = 1; n != 11; ++n)rn rn temp += FuncDeriQ(x, n) * cos(n * W * vecT[i]) + FuncDeriP(x, n) * sin(n * W * vecT[i]);rn rn temp2 = Param4[0] / 2 + EA * temp; rn vecOutputF.push_back(temp2);rn rnrnrnint _tmain(int argc, _TCHAR* argv[])rn/*rn vector vecT;rn int iCountT;rn int x;rn int i = 0;rn ifstream inStream("inputdataT.txt", ios::in);rn if (!inStream)rn rn cout << "Error!" << endl;rn return -1;rn rn cout << "this is " << endl;rn inStream >> iCountT;rn inStream >> x;rn while (!inStream.eof() && i != iCountT)rn rn inStream >> vecT[i];rn ++i;rn rnrn inStream.close();rn */rn ReadFile();rn FuncCalcC();rn CalcParam1();rn CalcParam2();rn CalcParam3();rn CalcParam4();rn CalcParamA();rn CalcParamB();rn CalcParamKandParamP();rnrn FuncU(x, vecT);rn FuncF(x, vecT);rn WriteFile();rnrn return 0;rnrnrnrninputdate.txtrn0.07rn0.022rn0.00001042rn30000rn792.5rn7850rn0.7959rn5172rn210000000000rn200rn793rn0.0000 0.0397 0.0793 0.1190 0.1587 0.1984 0.2380 0.2777 0.3174 0.3570 0.3967 0.4364 0.4761 0.5157 0.5554 0.5951 0.6347 0.6744 0.7141 0.7538 0.7934 0.8331 0.8728 0.9125 0.9521 0.9918 1.0315 1.0711 1.1108 1.1505 1.1902 1.2298 1.2695 1.3092 1.3488 1.3885 1.4282 1.4679 1.5075 1.5472 1.5869 1.6265 1.6662 1.7059 1.7456 1.7852 1.8249 1.8646 1.9042 1.9439 1.9836 2.0233 2.0629 2.1026 2.1423 2.1820 2.2216 2.2613 2.3010 2.3406 2.3803 2.4200 2.4597 2.4993 2.5390 2.5787 2.6183 2.6580 2.6977 2.7374 2.7770 2.8167 2.8564 2.8960 2.9357 2.9754 3.0151 3.0547 3.0944 3.1341 3.1737 3.2134 3.2531 3.2928 3.3324 3.3721 3.4118 3.4515 3.4911 3.5308 3.5705 3.6101 3.6498 3.6895 3.7292 3.7688 3.8085 3.8482 3.8878 3.9275 3.9672 4.0069 4.0465 4.0862 4.1259 4.1655 4.2052 4.2449 4.2846 4.3242 4.3639 4.4036 4.4432 4.4829 4.5226 4.5623 4.6019 4.6416 4.6813 4.7210 4.7606 4.8003 4.8400 4.8796 4.9193 4.9590 4.9987 5.0383 5.0780 5.1177 5.1573 5.1970 5.2367 5.2764 5.3160 5.3557 5.3954 5.4350 5.4747 5.5144 5.5541 5.5937 5.6334 5.6731 5.7127 5.7524 5.7921 5.8318 5.8714 5.9111 5.9508 5.9905 6.0301 6.0698 6.1095 6.1491 6.1888 6.2285 6.2682 6.3078 6.3475 6.3872 6.4268 6.4665 6.5062 6.5459 6.5855 6.6252 6.6649 6.7045 6.7442 6.7839 6.8236 6.8632 6.9029 6.9426 6.9822 7.0219 7.0616 7.1013 7.1409 7.1806 7.2203 7.2600 7.2996 7.3393 7.3790 7.4186 7.4583 7.4980 7.5377 7.5773 7.6170 7.6567 7.6963 7.7360 7.7757 7.8154 7.8550 7.8947 rn rn希望大家帮忙看一下哈?
这都越界?
[code=C/C++]rnrnrnfun函数的if(*p!='*') 这里越界!!!就是这里报错 !!!!rnrnrnrnrnrn#includern#includernrnrnvoid fun(char str[MAX_PATH])rnrn rnrn WIN32_FIND_DATA findData;rn HANDLE hFindFile;rn rn hFindFile=FindFirstFile(str,&findData);rn rn if(hFindFile!=INVALID_HANDLE_VALUE)rn rn rn dorn rn if(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)rn rn char* p;rnrn int nLen=strlen(str);rnrn //检测倒数最后一一个字符是否是\rn p=str+nLen-1;rnrn //2中可能,一种是 : c:\data; 另一种是: c:\data\*.*;rnrn if(*p!='*' )rn rnrn strcat(str,"\\*.*");rnrn rnrn fun(str);rn rn elsern rn printf("%s\n",findData.cFileName);rnrn rn rn while(FindNextFile(hFindFile,&findData));rn rn rn FindClose(hFindFile);rn rn rnrnrnrnrnvoid print(char str[MAX_PATH])rnrnrn int nlen=strlen(str);rn char* p=str+nlen-1;rn if(*p=='\\')rn *p='0';rn strcat(str,"\\*.*");rn fun(str);rnrnrnint main()rnrnrn char str[MAX_PATH];rnrn strcpy(str,"f:\\test");rnrn print(str);rnrnrnreturn 0;rnrnrnrn[/code]
越界listview
越界 回弹效果
相关热词 c++和c#哪个就业率高 c# 批量动态创建控件 c# 模块和程序集的区别 c# gmap 截图 c# 验证码图片生成类 c# 再次尝试 连接失败 c#开发编写规范 c# 压缩图片好麻烦 c#计算数组中的平均值 c#获取路由参数