我有下面的变量BabyCar NoMeNoT(10);未设置的TunMurnPosiv[5]=4;NoMultPosie[4]=9;NoMultPosi[3 ]=4;NoMultPoo[4 ]=9;NoMultPosi[O]=I.;NoMultPosi[O]=I.;NoMultPosi[O]=I.;NoMultPosi[y]=I.;然后我做了。NeWA
tiON= ATOI(NUMLBONT);结果是0x00 00 7CBF,但我预期0xFFFF7CBFF如果我设置了No.RealPosiv4到424950495,我就得到0xFFFFEB5F,就像我预期的那样,为什么我在一个案例中得到0x000而不是0xFFFF,而另一个它工作得很好呢?
以上来自于百度翻译
以下为原文
I have the following variables
char numberInput[10];
unsigned long newNumber = 0;
I set numberInput to
numberInput[0] = 4;
numberInput[1] = 2;
numberInput[2] = 9;
numberInput[3] = 4;
numberInput[4] = 9;
numberInput[5] = 3;
numberInput[6] = 3;
numberInput[7] = 6;
numberInput[8] = 9;
numberInput[9] = 5;
Then I do newNumber = atoi(numberInput);
The result is 0x00007CBF but I was expecting 0xFFFF7CBF
If I set numberInput to 4294950495 I get 0xFFFFBE5F like I would expect
Why am I getting 0x0000 instead of 0xFFFF in one case but in the other it works fine?