1

I was given a header file and I have to provide the implementation. I originally changed the FLOAT_ARRAY_H TO FLOAT_ARRAY_HPP. I also added comments after the directive which I have also deleted.

#ifndef FLOAT ARRAY_H
#define FLOAT ARRAY_H
#include <iostream> 
using namespace std;

If I need to combine all the files into one to post I will

letsintegreat
  • 3,328
  • 4
  • 18
  • 39
jfleck
  • 19
  • 7
  • 2
    Welcome to Stack Overflow! Please **[edit]** your question with an [mre] or [SSCCE (Short, Self Contained, Correct Example)](http://sscce.org). Also, please include the exact error messages in your post. – NathanOliver Jan 29 '21 at 14:55
  • https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4067?view=msvc-160 I googled the compiler warning you got, and got this page with a pretty clear description of what the warning indicates and what you can do about it. – Nathan Pierson Jan 29 '21 at 14:56
  • Building with what? VS Code? Explain how you build and quote the exact error message. **edit** nvm, it was just a typo, closure incoming hopefully :-P – underscore_d Jan 29 '21 at 14:56
  • Thank you both next time I will include the entire file, I read that page and that is why I moved the comments from after the pre-processor directive. – jfleck Jan 29 '21 at 15:00
  • 1
    Please also read [`"Why is “using namespace std;” considered bad practice?"`](https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice) -- especially in a header file. – G.M. Jan 29 '21 at 15:14
  • 1
    Also next time post the exact text of the warning. If this is Visual Studio Community/ Professional or Enterprise the text can be found in the Output Tab in a better format than the errors list. – drescherjm Jan 29 '21 at 15:16

1 Answers1

1

Sorry took me posting it to see that I was missing the space between FLOAT and ARRAY!

#ifndef FLOAT_ARRAY_H
#define FLOAT_ARRAY_H
#include <iostream> 
using namespace std;
jfleck
  • 19
  • 7
  • Did that solve the issue? – IWonderWhatThisAPIDoes Jan 29 '21 at 14:58
  • I read that you should never delete questions. Yes it did, I was confused by not having comments after the directives because they have never caused an issue before. The teacher uses camel case but I prefer to use the _ which is why I messed up. – jfleck Jan 29 '21 at 15:03