Home > Back-end >  C programming problem
C programming problem

Time:06-04

This situation does anyone know how to solve the

CodePudding user response:

This is just a warning is not necessarily wrong
Must be familiar with the range of data to be processed, if convinced that there is no problem, to avoid this warning can be combined with a casting
If it was the problem to change the type of the variable, before and after let can match

CodePudding user response:

This is a warning, and tell you the solution, casts,,
Or just use the same type,

CodePudding user response:

Personally, I think he is prompt in this kind of mistake, I guess, you can try to verify:

Char a=- 128, b=128;
Int c=a - b;
May hopefully result is - 256, but this time will be 0 c? You try it, I don't think it's tip is this meaning

CodePudding user response:

?

references reply: 3/f thousand dream life
personally, I think he is a hint to the mistake, I guess, you can try to verify:

Char a=- 128, b=128;
Int c=a - b;
May hopefully result is - 256, but this time will be 0 c? You try it, that's what I think it prompts mean


What a mean, isn't this should not be 0 c? How might be - 256
Even addition, it also should be - 256 rather than zero, unless the char c=a + b is possible overflow of 0

CodePudding user response:

Str++ + j STR + + j (+) or (str++) + j

CodePudding user response:

Fun
reference 4 floor response:
?

Quote: reference reply: 3/f thousand dream life

Personally, I think he is prompt in this kind of mistake, I guess, you can try to verify:

Char a=- 128, b=128;
Int c=a - b;
May hopefully result is - 256, but this time will be 0 c? You try it, that's what I think it prompts mean


What a mean, isn't this should not be 0 c? How might be - 256
Even addition, it also should be - 256 rather than zero, unless the char c=a + b is possible overflow of 0


Me? B: I didn't write code validation,
I mean, if I guess correctly, then he error is this meaning,

The compiler that int c=a - b; This is when the needs of the business may actually be want - 256 (otherwise why expand data width), but according to the algorithm to get the answer would be zero, but not you (probably) the desired - 256, so when a warning,

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related