0

I'm trying to pack a struct that looks like this on c++:

typedef struct {
    double    var1
    double    var2
} myType;

In my python script I have the user enter 2 inputs that I cast to a float.

var1 = float(input())
var2 = float(input())
payload = struct.pack("dd", var1, var2)

Now this won't work because I'm trying to send floats in as doubles. Is there anyway to get this working? I cannot change myType so that option is off the table.

topfoxrider
  • 143
  • 10

0 Answers0