To use an analog pin as input pullup for a digitalread

Do I need to do anything different than

  pin = togglePin;
  pinMode(pin, INPUT_PULLUP);
  instances.push_back(this);

which I’m currently doing in a CPP file for my inputs which are all of a type. I seem to have a floating pin and I’m wondering, as it’s an analog pin and the others which are working fine are digital, if I need to do anything different for it?

thanks

Actually you’d only need to do

pinMode(pin, INPUT_PULLUP);

the rest hasn’t got anything to do with the question raised in the topic title.

But how are do determine that the pin is floating?

Not clear what this is supposed to mean :confused: