Try using this:
Code:
#include <iostream>
#include <string>

void code() {
    string lin;

    getline(cin, lin);
}
This way you don't need to worry about array sizes