when I read it how can I find out there was an endline or not ?
How do you plan to use that information once you get it? That will somewhat determine what method you use. For example, you can run through the file character by character and look for '\n' to answer the simple question of whether a newline is present, but that may not be conducive to whatever you plan to do afterward.
Well if you use getline() it will read in everything in the file until it reaches a newline.
Until it reaches a newline or end-of-file (or an error occurs). So you'd need to check the stream state to be sure that the line ended with '\n' and not EOF.