255/40R18 is 1.00" taller than 255/35R18, a +4.01% change in diameter. That is more than the 3% many tire shops use as a limit, so plan on recalibrating the speedometer and checking ABS and stability control.
Ground clearance changes by 0.50" (half the diameter change), and the tire needs 0.50" more room above it.
Both tires are the same width, 10.04".
Both fit a 18" wheel; the sidewall is 0.50" taller on 255/40R18.
Details: 255/35R18 in inches · 255/40R18 in inches · change sizes in the calculator