Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions