My teacher said that carbon only forms covalent bonds. But there are in fact compounds in which a carbon is pretty much ionic, while remaining covalently bonded to other atoms. There is no such thing as a pure ionic bond.
All bonds involve the sharing of electrons to some degree, however small.
But of course, you can have any value of electronegativity difference, values just over 2 and values just under 2. We tend to define ionic bonds operationally, by the way a particular compound behaves under certain conditions. Now that I've said all that, let's talk about ionic organic compounds. But as you go down the alkali metals toward cesium, it is reported that the behavior of the carbon-metal bond becomes more and more ionic. You can also get ionic or nearly ionic compounds with cationic carbon, as long as the anion doesn't have a strong affinity for bonding to carbon and the carbocation is supported by electron-donating groups.