• Register
1 vote
139 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

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 166 views
166 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 Raphael Pacheco 4.9k points
1 vote
1 answer 67 views
67 views
Problem: I have very recently started with the iOS development and I am currently learning the use of NSData using the Obj-C. Currently I am trying to use the URLSession:dataTask:didReceiveData method to get the NSData by using the HTTP POST request. My server should ... (@"json error: %@", [error localizedDescription]); } } Please guide me if anyone knows the potential reason behind this problem?
asked Jun 1 Martin K 6.6k points
1 vote
1 answer 198 views
198 views
Problem : I have the big trouble with the iOS App: it just crashes sometimes without detailed debug error. The stack trace is also empty. Below are the only two lines in the stack trace: 1. Crash start in UIApplicationMain at "symbol stub for: - ... breakpoint in malloc_error_break with the libsystem_c.dylib without any feedback from the debugger. I have no idea regarding how to solve this issue.
asked Dec 16, 2019 alecxe 7.5k points
0 votes
1 answer 473 views
473 views
Problem : I have a serious issue with my iOS App: it crashes manytimes without detailed debug error. My stack trace is empty. Below are the only two lines in my stack trace: a. Crash start in UIApplicationMain at "symbol stub for: -[ ... breakpoint in malloc_error_break with the libsystem_c.dylib but without any feedback from debugger. I have no idea how can I solve this issue.
asked Dec 7, 2019 alecxe 7.5k points
1 vote
1 answer 32 views
32 views
Problem : I am very new to C++ programming. I am facing below error if I try to execute my code. Please find below the error: Warning: comparison between signed and unsigned integer expressions . Please find below my erroneous code: vector<long int> row;     long n,m;     long ... ;i<row.size();i++) I am looking for quick fix for my above error can some c++ expert help me in fixing above error ?
asked Apr 25 stewart 4k points