对不起,如果这是一个菜鸟问题:(.
一块C代码.
int array[5];
int cnt;
for(cnt = 0; cnt <= 10; cnt+=1)
{
array[cnt] = cnt;
}
Run Code Online (Sandbox Code Playgroud)
应该给出错误吧?没有!工作良好!但那是为什么呢?似乎 - 在第一行 - 定义了超过双倍大小(11)的数组.您甚至可以稍后访问数组[5到10].这让我很困惑.定义数组[4或更少]时它停止工作...
提前致谢.
我现在很漂亮,因为我不断收到亚马逊的不完整回复.我正在使用Product Advertising API,向服务器发出一个ItemLookup请求.
C#代码非常基本:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse) request.GetResponse();
string resultString;
using (StreamReader sr = new StreamReader(response.GetResponseStream()))
{
resultString = sr.ReadToEnd();
}
Run Code Online (Sandbox Code Playgroud)
我收到的字符数是17408-非常稳定,但我也看到了16k左右的东西.
这就是它总是如何结束:
...ount><CurrencyCode>EUR</CurrencyCode><FormattedPrice>EUR 11,33</FormattedPri
Run Code Online (Sandbox Code Playgroud)
有什么我不知道HttpWebRequest或亚马逊的API?请帮忙!
网址(不关心密钥)编辑:坏主意,限制超出...