• Register
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?

6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

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.

9 7 4
38,600 points

Related questions

0 votes
1 answer 14 views
14 views
Problem: typeerror: no implicit conversion of symbol into integer.
asked Feb 24 Dan phillip 4.7k points
0 votes
1 answer 71 views
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?
asked Nov 8, 2020 Festus James 380 points
0 votes
1 answer 2 views
2 views
Problem: Please help me fix this dilemma: which data type has more precision? a. double b. float c. int d. long int?
asked Mar 30 tuhin1 48.4k points
0 votes
1 answer 678 views
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;     }
asked Jul 29, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 1 view
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.
asked 1 day ago ummesalma 24.5k points
0 votes
1 answer 2 views
2 views
Problem: Can anyone tell me the solution of this problem? how to get mac address on iphone
asked Mar 26 Ifra 24.4k points
0 votes
1 answer 5 views
5 views
Problem: I have an issue that i am unable to find any apps in `.angular-cli.json`. please solve this issue.
asked Mar 22 waseem memon 2.4k points
0 votes
1 answer 3 views
3 views
Problem: I have a problem that i am unable to find any instance for object index.
asked Mar 22 waseem memon 2.4k points
0 votes
1 answer 3 views
3 views
Problem: I have an issue that i am unable to find module info file can anybody solve this issue.
asked Mar 22 waseem memon 2.4k points
0 votes
1 answer 3 views
3 views
Problem: I have an issue that i am unable to find remote helper for https.
asked Mar 22 waseem memon 2.4k points