The code is doing precisely what it should; it's simply that you're missing an aspect of what's happening.

Now, you haven't show it here, but I'll bet that somewhere prior to the note1out() call, you're using operator >> to extract something from cin. As usual, anything you enter on the console goes into the input stream, and typically you'll end an input by hitting return. This puts a newline into the input stream, of course.

However, operator>> doesn't read that newline, since operator>> stops when it encounters whitespace by default. If you only use operator>>, then this isn't a problem; the extra newline in the stream will be skipped on the next read (since >> skips whitespace).

But if you call >> and then you call getline(), you run into a tricky situation. getline() by default reads until it sees a newline. But there's already a newline in the stream from the preceeding operator>> usage. So getline() just finds it and returns immediately.

Now, you could call getline() twice, or you could use cin.ignore() to explicitly get rid of that extra newline. The trouble is.....it's only correct to do this between a >> and a getline(). Between two >> it won't really matter, but between two getline()s there's a good chance it won't do what you want. Which brings us to your code: You're calling getline() at the start of a function, which means you need to make sure that the last cin operator prior to the function call was *not* another getline(). Maybe your program is simple enough that this is an easy guarantee....maybe not.

One option you could do is to create a wrapper for cin (or any other istream) which imposes the desired behavior, but that's probably overkill in your case.