Find the error. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
5 Answers
+ 2
@Pawel iostream is a header file. It is the "newer" version of iostream.h. It doesn't have an extension because none of the C++ library headers (except the C compatibility headers, which are deprecated) have extensions. The reason for that is quite simple, if you think about it. There were many implementations for vectors already in use by that point. Many of them using <vector.h> as a header. Not including the file extension is a way to avoid conflicts. But that doesn't make iostream not a header. Unlike in Windows, in Linux (and all *nix systems for that matter) file extensions don't actually *do* anything. They're just a way to tell the user (and not the machine) the type of the file in question.
26th Jan 2018, 1:19 PM
Vlad Serbu
Vlad Serbu - avatar
+ 3
Change: #import <iostream.h> to: #import <iostream> The reason is because there is no iostream header file.
26th Jan 2018, 9:55 AM
Paweł Karaś
Paweł Karaś - avatar
26th Jan 2018, 9:58 AM
ImranKhan CD
ImranKhan CD - avatar
+ 2
Thanks @Vlad, I have finished my C++ tutorial some time ago and as you can see... my knowledge is still incomplete... Regards!
26th Jan 2018, 1:33 PM
Paweł Karaś
Paweł Karaś - avatar
+ 1
thanks @Vlad
26th Jan 2018, 3:54 PM
ImranKhan CD
ImranKhan CD - avatar