Hello,
I have recently come across a problem in my program, the worst part is that it is my last error and I have no idea what it takes to fix it.
I was given the following two warnings:
[...] : warning C4305: 'argument' : truncation from '__int64' to 'size_t'
[...] : warning C4309: 'argument' : truncation of constant value |
All that I have been able to find is that it relates to the OS system (Yay! I found out a way of knowing if I'm running 32 or 64 bit....), and yes I am running 64.
Now I imagine the code is also needed so here are the key points. I would prefer that no one recommend changes that are not pertinent to the problem, I am here only for this.
1 2 3 4
|
size_t main()
{
List myList;
myList.concatenate(524321654987); // this is the line where the error occurs
|
the function header is found in a .h file, and implementation in another .cpp
|
void concatenate(size_t num);
|
1 2
|
void List::concatenate(size_t num)
{...}
|
The number that is used works fine until you hit 7 digits, after that it simply gives the error. I have tried to input the number via cin, in that case there is no error message, but the program still runs with the truncated version. (ex: 321654987 becomes 3 654 987).
Thank you for any help on the subject.