Q:

Super basic code: Why is my loop not breaking?

for(int i=0;i<50;i++,size++)
{
    cin >> inputnum[i];
    cout << size;
    if(inputnum[i] == '.')
    {
        break;
    }
}

The break breaks the input stream but the size keeps outputting. 
The output of size is 012345678910111213...474849. 
I tried putting size++ inside the loop but it made no difference.  And size afterwards will be equal to 50, which means it went through the full loop.
I forgot to explain that I added the cout << size within the loop to debug/check why it outputted to 50 after the loop even if I only inputted 3 numbers.

A:

I suspect that inputnum is an array of int (or some other numeric type). When you try to input '.', nothing actually goes into  inputnum[i] - the cin >> inputnum[i] expression actually fails and puts cin into a failed state.
So, inputnum[i] is not changed when inputting a '.' character, and the break never gets executed.
Here's an slightly modified version of your code in a small, complete program that demonstrates using !cin.good() to break out of the input loop:
#include <iostream>
#include <ostream>

using namespace std;

int main()
{
    int inputnum[50];
    int size = 0;

    for(int i=0;i<50;i++,size++)
    {
        cin >> inputnum[i];
        if (!cin.good()) {
            break;
        }
    }

    cout << "size is " << size << endl;    
    cout << "And the results are:" << endl;

    for (int i = 0; i < size; ++i) {
        cout << "inputnum[" << i << "] == " << inputnum[i] << endl;
    }

    return 0;
}

This program will collect input into the inputnum[] array until it hits EOF or an invalid input.

