小编spi*_*man的帖子

数组中的元素太多了!

对不起,如果这是一个菜鸟问题:(.

一块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或更少]时它停止工作...

提前致谢.

c arrays size double

5
推荐指数
3
解决办法
1481
查看次数

HttpWebRequest和WebResponse.GetResponse给出了不完整的响应

我现在很漂亮,因为我不断收到亚马逊的不完整回复.我正在使用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?请帮忙!

网址(不关心密钥)编辑:坏主意,限制超出...

c# amazon response httpwebrequest httpwebresponse

5
推荐指数
1
解决办法
7503
查看次数

标签 统计

amazon ×1

arrays ×1

c ×1

c# ×1

double ×1

httpwebrequest ×1

httpwebresponse ×1

response ×1

size ×1