What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 131 Stack Exchange communities.

This question already has an answer here:

In Mark Wilkins' answer to Counter not giving the expected result, he has some code that looks like this:

   if (i == var4)
   {
        cout << "\n Armstrong number " << counter << ": " << var4;
        counter++;
   }

      i++;

i++ is not formatted as code, despite having the same indentation as the line directly above it (which is).

Screenshot for effect

Why is this so?

share|improve this question

marked as duplicate by Wesley Murch, Lance Roberts, animuson, Martijn Pieters, ChrisF Mar 5 '13 at 22:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 10 down vote accepted

The spaces looked identical but were not. It must be indented with plain spaces, no crazy unicode or tabs.

share|improve this answer
    
Nice spot, thanks! 20c2 a020 c2a0 20c2 a020 692b 2b3b 0a .. .. .. i++;. –  Johnsyweb Feb 27 '13 at 22:26
3  
Funny thing is, using Chrome on Mac, sometimes my spacebar will insert a no-breaking space too... Perhaps I accidentally hit a modifier key somewhere. –  Martijn Pieters Feb 27 '13 at 22:41
2  
It happens to me too, but I don't recall hitting any modifier. –  kiamlaluno Feb 27 '13 at 23:16
    
Tabs actually work just fine. –  Dennis Feb 28 '13 at 1:12
    
This happened to me once too -- and it was also with Chrome on the Mac. –  Ernest Friedman-Hill Feb 28 '13 at 5:20
    
Nick, note that someone else reported "in Chrome on Windows 7 Pro, I copied a block of code already in the site and pasted it just below the block that I copied - doubling the size of the block". @Ernest, do you happen to remember if it was a copy & paste action for you too? And please see balpha's answer here if it ever happens again... –  Arjan Mar 5 '13 at 21:02
    
@Arjan -- I believe it was indeed copy/paste, not from within the site, but from some other app into Chrome. –  Ernest Friedman-Hill Mar 6 '13 at 2:43

Not the answer you're looking for? Browse other questions tagged .