I don't think you can do that with cin. I tried it and when you just hit return it still waits for user input. Now if there is a way to make cin accept just hte return key the string it returns should be either "\n\0" or "\0". So your if statement would be one of these:
Code:
if (sym_size[0] == '\0')
{//blank input
Code:
if ((sym_size[0] == '\n')&&(sym_size[1] == '\0')
{//blank input
Alternatively you can use the getch() function which returns after a single keypress to get the input. You'll need to place it in a loop to actually get the input:
Code:
char input[512];
int ctr;
for (ctr = 0; ctr < 512; ctr+)
{
input[ctr] = getch();
//getch() won't echo the character to screen
printf("%c", input[ctr]);
if (input[ctr] == '\n')
{//the user hit return, stop getting characters
break;
}
if (input[ctr ] == '\b')
{//user hit backspace, remove a character
ctr -= 2;
}
}
if (input[0] == '\0')
{
//user didn't give a value insert the default
}
You may need to clean that up a bit, but that should give you an idea how it would look.
FYI: getch() only exists on windows (include conio.h) there is a good tutorial on the board somewhere (I seem to have lost the link) to get it to work on Linux if need be.