In future labs, you will use a makefile that invokes a git "clone" command, which creates a specially tagged directory for you. That one will have to be called csci159. So make sure that you don't have a directory called csci159 in your home directory when you come to lab next week. We'll call this one "csci159dev" (for "development") so you know it's not your git stuff.
mkdir csci159dev
cd csci159dev
ls
mkdir lab1
cd lab1
vi sizes.cpp
#include
and set the namespace to std. (Use the semicolon after
that last part.)
g++ sizes.cpp -o sizesxKeep editing and compiling until it compiles without errors.
int, float, double, char, short, long, long long, bool
You will need an expression that gives you the answer,
which you can write to the screen. It is provided for you
here, but you still have to embed this expression
in a cout statement -- treat it like an integer
(because that is it's return type).
sizeof(int)
Add some code that tells how many bits are in a byte.
Use CHAR_BIT, as if it is an integer. Do you need a header
for it's use? Look here to determine what header to
use:
sizesx:
g++ sizes.cpp -o sizesx
The whitespace before the "g++" MUST be a tab!
Now try the command
make
sizesx: sizes.cpp
g++ -Wall -Wextra sizes.cpp -o sizesx
average3: average3.cpp
g++ -Wall -Wextra average3.cpp -o average3x
Now the makefile has two options, and you
will have to tell it what you want on the
command line:
make average3a make sizesx