User Tools

Site Tools


journal:fall2017:sdavisii:start

Sterling fall2017 Journal

C/C++


Introduction


cprog week11


MONTH Day, YEAR

Filler text- your entry goes here; remove this line to receive full credit.

hpc1 week11


MONTH Day, YEAR

Filler text- your entry goes here; remove this line to receive full credit.

cprog week10


MONTH Day, YEAR

Filler text- your entry goes here; remove this line to receive full credit.

hpc1 week10


10, 30 2017

cprog week9


10,23 17

use g++ to compile c++ programs

end file with .cc .cpp .c++ .c

this → - refers to class variable

g++ -c -compiles it if there are no main func

g++ -o file file file- compile multiple files together

hpc1 week9


MONTH Day, YEAR

Filler text- your entry goes here; remove this line to receive full credit.

cprog 8


oct 16, 17

functions- procedure function y=sqrt(x);- function fprintf(jkndsbnad);- procedure

int main() int- return value main-name ()- parameters

int main(int argc, char **argv) function signature (all three parts)

two types of passing pass by value (read only) pass by address (read/write)

double sqrt(double);- used for sqrts to use a function:

  • declare/prototype
  • define
  • call

declare functions outside of main makes them global

hpc1 8


MONTH Day, YEAR

Filler text- your entry goes here; remove this line to receive full credit.

cprog week7


MONTH Day, YEAR

Filler text- your entry goes here; remove this line to receive full credit.

hpc1 week7


MONTH Day, YEAR

Filler text- your entry goes here; remove this line to receive full credit.

cprog week6


MONTH Day, YEAR

Filler text- your entry goes here; remove this line to receive full credit.

hpc1 week6


MONTH Day, YEAR

Filler text- your entry goes here; remove this line to receive full credit.

cprog week5


MONTH Day, YEAR

Filler text- your entry goes here; remove this line to receive full credit.

hpc1 week5


MONTH Day, YEAR

Filler text- your entry goes here; remove this line to receive full credit.

cprog week4


9, 18 2017

notes-

when you allocate a resource do an error check

An ioctl(2) is a method (and system/library call) for manipulating underlying device parameters of special files

To interact with a file, we must first declare a pointer to type FILE that will be our point of transaction.

Common names for our file pointer variable are fp, fPtr, input, inp, but in reality can be anything you want.

  r - open file for reading (start at beginning)
  w - open file for writing (start at beginning)
  a - open file for appending (add to end)

input = fopen (“sample0.txt”, “r”); fgetc()

To read a byte of data from a file and store it in our variable (called byte), we would do the following:

  char byte  = 0;

byte = fgetc (input);

hpc1 week4


MONTH Day, YEAR

Filler text- your entry goes here; remove this line to receive full credit.

cprog week3


Sept 11, 2017

notes-

check funwithfors.c

for(start; loopcondition; step)


commands-

hpc1 week3


MONTH Day, YEAR

Filler text- your entry goes here; remove this line to receive full credit.



journal/fall2017/sdavisii/start.txt · Last modified: 2017/10/13 09:04 (external edit)