Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given the following .h and.cpp files, which of the following g++ commands is the proper way to build the executable program? File: Storeltem.h File: Storeltem.cpp
Given the following .h and.cpp files, which of the following g++ commands is the "proper" way to build the executable program? File: Storeltem.h File: Storeltem.cpp #ifndef STOREITEM_H #include #define STOREITEM_H using namespace std; #include "StoreItem.h" class StoreItem public: void SetweightOunces(int ounces); void Print() const; private: int weightOunces; }; void storeItem::SetWeightOunces (int ounces) { weightOunces = ounces; } void StoreItem::Print() const { cout using namespace std; #include "StoreItem.h" int main() { StoreItem item; itemi. SetWeightOunces (16); itemi. Print(); return ; } g++ main.cpp Storeltem.h -o test -std=c++11 Og++ main.cpp Storeltem.cpp -std=C++11 g++ main.cpp Storeltem.h Storeltem.cpp -std=c++11 Og++ main.cpp Storeltem.cpp -o test -std=C++11
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started