Using IPAddress object

claudepio
Posts: 1
Joined: Wed Feb 02, 2022 1:50 pm

Using IPAddress object

Postby claudepio » Wed Feb 02, 2022 2:32 pm

Hi,

I am trying to copy set an IPAddress object with the IP from another IPAddress object.
I am using the following code which is throwing an error on compile;

IPAddress ip1;
IPAddress ip2(192.168.1.1);

ip1 = ip2;

How can I copy the IP from ip2 into ip1?

Appreciate any help.
Cheers,
Claude

User avatar
mbratch
Posts: 298
Joined: Fri Jun 11, 2021 1:51 pm

Re: Using IPAddress object

Postby mbratch » Sat Apr 02, 2022 7:45 pm

I am using the following code which is throwing an error on compile
Exactly what error are you getting?
The assignment operator= for the class should copy it Ok.

Who is online

Users browsing this forum: No registered users and 21 guests