I'm trying to Down size a 5 digit number on an array of  values each value has well 5 digits
i want to just use the last two digits for the value how would i be able to do that with
the modulus operator. I was told the mod OP would be perfect, i just dont know how to use it with arrays..
Um..... I think you want to do a modulus operation of 100 on each element in the array, but your description is so ambiguous and vague, I can't figure out what you want.
i did specify that i dont know how to use the modulus when it comes to arrays i get errors when i try to use my assignments.
examples would be
array %= 100
*(array % 100)
lame examples but im new sorry
So what do you want? An array tutorial, or a modulus tutorial?
unless you want to rewrite the C Primer book is up to you. But no really i would just like an example on how would i be able to use the modulus OP on an array with values but im guessing its hard to think of the answer.
You're guessing wrong. This is super easy.
Assuming all variables are ints in this example, if array is 1234, x should contain 34.
x = array % 100;
Yes, this would work: array %= 100; (if you want to assign the result back to array)
What errors do you get? What does your code look like?
And it's worth noting that the language C doesn't have ANY operations that operate on all elements in an array - you can call a function that, given the array and the size of it, can do something on the whole array by ways of doing a loop in the function, but the C language itself only sees arrays as a sequence of elements - there's no way you can actually operate on "all elements of this array" in one fell swoop.