Some teachers say that you can write the equation of any straight line in the form y = mx + c, but it's not true. It doesn't work for lines that are parallel to the y-axis. The equation of such a line is x = constant, for example, x = 0 or x = -5.
The equation of any straight line can be written in the form ax + by + c = 0 and I guess that's why some writers prefer it to y=mx+c.
If you replace a with 1 and b and c with 0 you get 1x + 0 + 0 = 0 which is simply x = 0, the equation of the y-axis.