How to use while loop in arduino for infinte loop I am doing code of esp while switching hotspot for connecting esp i am getting some problem .
I am using this line of code:

while ((!esp.find("WIFI ")) || (!esp.find("+CWJAP:3")));


but it is not working. Anybody please give me alternate how to use this type of looping.
The find method reads the characters until the searched string is found or a timeout interval is passed.

In your case if the connection is not successful, the first find will not find "WIFI" and will read all the input including the "+CWJAP:3", then on timeout it returns false. The second find will wait until timeout and then return false.