# Implicit conversion loses integer precision: 'time_t' (aka 'long') to 'unsigned int'

1 vote
255 views

## Problem :

I am currently doing an exercise from the textbook and the book is very outdated, so I am tring to figure out how it really fits into the current system as you go along. Following is the exact text but  it is returning error

'Implicit conversion loses integer precision: 'time_t' (aka 'long') to 'unsigned int''.

It is on this srandom(time(NULL)); line.

If I try to replace time with time_t, then it comes up with another error message as below :

Unexpected type name 'time_t': unexpected expression.

I have no idea what either of them mean. The question which I read with the same error was apparently something trying to do with 64- and 32- bit integers but, actually, I don't know what that actually means. How to fix this error?

## Solution :

It is just the notification. You are trying to assign the 'long' to 'unsigned int'

So the solution is very simple. You need to just click the yellow notification icon on your left ribbon of that particular line where you are trying to assign that value. So it will just show a solution. Double click on the shown solution and it will do everything automatically.

It will just typecast to match the equation. And this fixes your issue.

## Related questions

14 views
Problem: typeerror: no implicit conversion of symbol into integer.
71 views
Problem: Hello Kodlogs, Playing my way around with this code contact_list = [ {"name" => "jack", "phone_number" => "6789"}, {"name" => "Tracy", "phone_number" => "2345"} ] contact_list.each do |contact| puts "Contact: #{contact_list["name"]} and ... : #{contact_list["phone_number"]}" end It returns: no implicit conversion of String into Integer (TypeError) How do I correct this I'm confused?
2 views
Problem: Please help me fix this dilemma: which data type has more precision? a. double b. float c. int d. long int?
678 views
Problem: I am very new to Java and trying to learn arrays in Java. I am trying to enter one int and the other long ex: 1 and 1000000000 and now I am trying to create the array of size 1000000000. And after creating the array at each index of my array willing to store int val, ex: arr[ ... [1]);     long []arr;        arr = new long[y+1];         for(long j=0;j<=y;j++)         arr[j] = 4;     }
1 view
Problem: My problem arises when I add a SKPayment to the SKPaymentQueue. After I add the product to the queue, in the paymentQueue:updatedTransactions method the transactions always have the state SKPaymentTransactionStateFailed.
2 views
Problem: Can anyone tell me the solution of this problem? how to get mac address on iphone
5 views
Problem: I have an issue that i am unable to find any apps in `.angular-cli.json`. please solve this issue.