1.) C++(1342)

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

In order to use various libraries in C++ must use #________

#include!

Class1: Main .cpp int main(){ Birthday birthObj(09, 08, 1998); char name[20]="Gian the king"; People gianRinald(name, birthObj); //Output "Gian the kings was born // on 09/08/1998" gianRinald.printInfo(); } *2 Final Questions: 1.) What are the headers of each SOURCE FILE* "Giancarlo's 3 Types" Type1. Whenever using functions of another class must use headers Type2. Additional packages Type3. Essential packages input, output and static user namespace, plus the header file of the class.

*Birthday.cpp headers:* Type 1: #include "Birthday.h" Type 2: no attachments Type3: #include "iostream" user namespace std; *People.cpp headers:* Type 1: #include "Birthday.h" Type 2: //attatchments only in .h //#include<cstring> in .h Type3: #include "iostream" user namespace std; *Main.cpp headers:* Type 1: #include "People.h" #include "Birthday.h" Type2: /*includes all packages that are used to create objects in first place! if an object takes in a packaged variable must attach package to .h file, not necessary in source file.*/ #include <cstring> Type3: #include<iostream> using namespace std;

*NOTE: MAIN HEADERS* Includes all packages that are used to create objects in first place! if an object takes in a packaged variable must attach package to .h file, not necessary in source file.

*NOTE: MAIN HEADERS* Includes all packages that are used to satisfy parameters of objects in first place! if an object takes in a packaged variable must attach package to .h file, not necessary in source file.

*Part 2: Pointers* https://www.youtube.com/watch?v=CSVRA4_xOkw

*Part 2: Pointers* +If you don't want to declare a global variable but want it in main function.

*Part 3: Objects, A class per source file*

*Part 3: Objects, A class per source file*

*Part1: Memory*

*Part1: Memory*

NOTE: *Pass by Reference: int main() { int data =10; add(data); cout<<"Value in data="<<data<<endl; return 0; } void add( int& x){ int input; cout<<"Enter the value to be added:" <<endl; cin>>input; x= x+ input; } OUTPUT: (same as last FC) Value in data = 30

*Pass by Reference: *HINT: Void and &* +because we are not returning and can access memory with the address-of operator. +int& x is a ref variable of data means x and data are connected +if you change value in x , then value in data changes automatically.

NOTE: *Pass by Value: int main() { int data = 10; //copy of data passed // gonna be reassigned data = add(data); cout<<"Value in data: "<<data<<endl; } int add(int x){ int input; cout<<"Enter the variable to add to data"<<endl; cin>>input; //reassign x before returning x= x + input; return x; } OUTPUT: Value in data = 30

*Pass by Value: A copy is made of a variable. A new variable is made in a new function. Which is why Dr.Fontenot likes representing data variable with a name different than the variable passed in main function. +When add function is called, A new variable x is made in add function, Which represent data variable, which is passed as argument.

*Project 1 : Fractions Everywhere*

*Project 1: Fractions Everywhere*

*Project 2: Fractions in IO File*

*Project 2: Fractions in IO File ALEC FEEDBACK: Always leave code polished and your program:

*Project 4: How Many Anagrams*

*Project 4: How Many Anagrams*

*Project 5: OOP Blackjack*

*Project 5: OOP Blackjack*

*Project 3: Connect 4*

*Project3: Connect 4*

*QUIZ 1*

*QUIZ 1*

*Quiz 2*

*Quiz 2*

*Transition To Data Structures*

*Transition To Data Structures*

Process: Blackjack();

+ BlackJack(){} +manipulate card object + call CardShoe when needing to shuffle -and keeping track of 52 cards +ostream& operator<<(); -function overides opperators allowing to print the face value and suit by simply cout<< C1 or C2.

Input:

+ Player Name +Hit or Pass +Prompt user to play again after deck is used up

Instructing user to enter fraction: cout : << : endl: \n: cin : >> :

+*Output object* prints out all character in the same string +String *insertion operator* +*End line* +*New line* +*Input String Object* +String* extraction operator*

+If()

+Inside if statement is the "test" NOTE: Use bitwise operators

Process: Int Main();

+Int Main(){} +Call Blackjack +Set up while loop for game

Output:

+Intro +One card facing up and one facing down for both dealer and player +Print out the card values until the user busts +Print out the dealers value and keep hitting untill it passes 17 threshold.

Stack: Area of memory that holds all local variables and parameters used by any function.

+Lets us know where our function is and how we're doing in program. +Stack frame organizes all static memory

+Int sum= a + b

+NOTE: Must be inserted after variables involved are initiated, in this project after the cin (input string object).

Pointers and relationships to arrays: What is the output? int main(){ int numbers[5]; int * p; p= numbers; *p=10; p++; *p =20; p = &numbers[2]; *p=30; p = numbers; *(p+4) = 50; for (int n=0; n<5; n++) cout<< numbers[n]<<" , "; return 0; }

+Similarities: Pointers and Arrays support the same set of operations, with the same exact meaning -Diferences: Pointers can be assigned new addresses. Output: //Array 10, 20, 30, 40 , 50

STEP 2: Comparing the characters in pointer array by using a char temp[50] length of an character array? comparing characters?

+Used strlen to compare legth and if length is equal then ... +Compare characters of temp word to every single letter in word. If the count (of letters matching) equals the length of the char array, then it is an anagram.

Heap: Name for block of RAM used to store dynamic variables.

+Variables get randomly allocated in Heap

*Process:*

+You must use null-terminated c-strings (array of characters terminated with null). You may NOT use string objects from the standard library. You are free to use the c-string functions discussed in our last class session, namely strcpy, strcat, and strcmp. +Your program should be properly functionally decomposed. Remember that a function should do one thing and do it well. Try to minimize the actual amount of code in main; use it for a controller that just calls other functions. +You may assume that the input file will not contain more than 1000 words and that no word will exceed 50 letters. +Your program should use a minimal amount of stack allocated memory to store the array of c-strings. That entire structure should be heap-allocated. +All c-strings should be properly sized for the strings they are holding. Make sure to properly free memory when you're no longer using it.

This keyword: Mian.cpp int main(){ Hannah ho(23); //this identifies special pointer that //stores address of ho ho.printCrap(); } Hannah.cpp void Hannah:printCrap(){ cout<< h-> = ; //"use object pointint to, and the //varible wanting to use. cout<< this->h; cout<< (*this)->h; //1.)using this keyword to talk about //ho, storing special type of pointer //2.) (*this).h , derefernces pointer //takes memory location of curr //object and calls the variables //value. }

-> Operator Overloading!

Class 3: Birthday.h * doesn't require user name space because created using integers* class Birthday{ public: Birthday (int m, int d, int y); void printDate(); private: int month; int day; int year; }; #endif

.cpp #include "Birthday.h" //#include "People.h" #include<iostream> using namespace std; Birthday::Birthday(int m, int d, int y){ month = m; day = d; year = y; } void Birthday:: printDate(){ cout<<month<<"/"<<day<<"/" . <<year<<endl; }

Class2: People.h *Must include the header of the class object is composed of* #ifndef PEOPLE_ H #define PEOPLE_H *#include "Birthday.h"* *#include <cstring>* #include <iostream> using namespace std; class People{ public: People(char[] x, Birthday bd); void printInfo(); private: string name; Birthday dateOfBirth; }

.cpp #include "People.h" #include "Birthday.h" #include <iostream> using namespace std; *//composition member synt* People:: People() : name(x), dateOfBirth(bo) { } void People:: printInfo(){ cout<< name<< "was born on "; dateOfBirth.printDate(); }

Create code that prints out the following when entering 3: * ** *** ** *

//PART 1 int height=3 for(int i=0; i<= height;i++) { for(int j=0; j<i; j++) { cout<<"*"; } cout<<endl; } //PART2 int secondHalf=height-1; for(int i = secondHalf; i>0; i--) { for(int j=i; j>0; j--) { cout<<"*"; } cout<<endl; }

Constant variables; cons int x= 3; +can no longer be changed in main. +can only call constant functions with them.

//constant function created in //source void Sally:: print() *const*

Accessing Functions within a class: 1.) //declare object then call function 2.)Arrow Member Selection Operator: //declare a pointer type Object

1.) Sally sallyObject; sallyObject.printCrap(); 2.) //declare a pointer type Object Sally * sallyPointer; sallyPointer= &sallyObject sallyPointer->printCrap();

1.) Description P02: *Comments* Input: Output: Process:

1.) Description: *Comments* Input: +User will give worksheet file name +request amount of problems in file +answer problems in worksheet file Output: + Generate requested amount of fraction problems in file +Correction worksheet in file Process: +Will use the random file, for loop to produce random fractions and if statements to determine answer of generated variables +Will determine if answer is correct, but not simplified. WIll determine if answer is correct and simplified! +Will respond with nice sayings in a generated file(that is generated automatically when using the appropriate syntax)

1.) P01: *Comments* Input: Output: Process:

1.) Description: *Comments* Input: Two fractions Output: The simplified sum or difference Process: Add or subtract fractions inputed

C Strings: Header file defines several functions to manipulate C strings and arrays. Covered three essential functions: 1.) copy strings: from char array following the coma to name of first char array. 2.) comparing strings: *if contents of both character arrays are exactly equal then will return 0* if the first ptr is of lower value (ASCII RULE) will return number smaller than 0. If first character is bigger will return number grater than 0. 3.) String length: Will return the length of char array by including the name in parenthesis strlen(name)

1.) strcpy(paste, copy) 2.)strcmp(const char *str1, const char * str2) EX: if (strcmp(name1, name2) ==0) 3.)size_t strlen(const char * str); EX: char mystr[100] ="test string"; //Output= 11, counts all //characters in string //including null, but nothing //passed that int x= strlen(mystr) cout<< x<<endl; //Output= 100, disregards //focuses only on size int y=sizeof (mystr); cout<<y<<endl;

SIMPLE SUMMARY:

1.)The user starts your program. 2.)The user is prompted to enter an input file name. 3.)The program processes the input file or outputs an error message if the input file cannot be opened. 4.)If the input file was accessible, the program outputs the required information as indicated in Sample Output.

2.) Input & Output: Syntax & *Code Quality*

2.) Input & Output: Syntax & *Code Quality*

3.) Process : Logic & *Functionality * MENTALITY: Outside world doesn't need to know

3) Process: Logic & *Functionality*

3.) Process : Logic & *Functionality *

3.) Process : Logic & *Functionality *

Pointer: Declaring pointer: Initiating pointer: Cout<< pointer? How to print out the value?

:A data type that "points" to another value stored in memory (in the example bellow *p is an alias for x). : int* p; :int* p= &x; :Address :cout<< *p<<endl;

+ . ofstream file: + file.open("tuna.txt")

:Creates file object, the name is file :Opens the file named tuna Edit the file object and not the name itself, not permitted by C++

Pointer to a pointer: https://stackoverflow.com/questions/644981/what-is-in-c char** sets;

A pointer to an array. This is a generalization of the above case, since a "string" (a C-style string, anyway) is really just an array of chars. An array of pointers. You might, for example, have an array of pointers to objects, allowing for *polymorphism*, or an array of pointers to select objects stored in another collection. An array of arrays. Again, arrays degrade to pointers, so this is a specific case of the above. This is often used for so called *"jagged" arrays* (as opposed to rectangular).

Challenges with Dynamic Memory Allocation:

AVOIDING: 1.) Garbage Data 2.) Dangling Pointers

Stack Overflow:

Allocated an extremely large integer that is bigger than total size of stack. Avoid: Must allocate on heap, which is ginormous

Arrays ____ aware of their size?

Are not!

Garbage: 2 ways: Type 1(common): void x(){ int * p = new int; //some other code } //After function above terminates, the stack frame gets popped off and pointer disappears but memory in heap remains! Type 2: When data type is allocated on the heap and is no longer accessible, memory can no longer be referenced on the heap and eventually will run out of heap space and crash a program! *NOTE: Coders responsibility to AVOID CREATING GARBAGE: BY REALLOCATING MEMORY AND DEALOCATING SPACE IN HEAP* Avoiding Garbage: int* p= new int; *p =5; p= new int(10);/*garbage created >:( */

Avoiding Garbage: Before reassignment of a pointer to something else out on the heap 1.) delete p; to clear memory in heap, before reassigning pointer in order to avoid a collateral dangling pointer

Object: Basic unit of OOP this is both *data and function that operate on data are bundled as a unit* called as Object

Class: When you define a class, its defining a blueprint for an object. Does not define data, but instead what any object of the class will consist of and what operations can be performed on such an object.

Pointer in Paramaters: *by Reference* (VS: void byReference(int &a){ a+=5; }) *by Reference Pointer* void byReferencePointer(int *a){ *a += 5; } int main(){ int* mypointer2= nullptr; options: 1.) byReference(myPointer2); 2.)byReference(*myPointer2): 3.)byReferencePointer(myPointer2);4.)byReferencePointer(*myPointer2);

Correct! 1.) ByReference: +Error! Function will try to access null ! Will get error function needs a variable; Not....: 2.) + Will work! but not supposed to so do not use pointers! Correct 3.) +Pass the variable name no need for *derefence operator* ByRefPointer:

Dynamic Memory Allocation and Deallocation:

DMA: +DMA allows you to *set array size dynamically during run time rather than at compile time.* This helps when the program doesn't know in advance about the number of items (variable values ) to be stored. *DMA is an application of pointers!* pointer summary: A pointer is a variable whoase value is the address of another variable. Uses: +Pointers allow one to refer to the same space in memory from multiple locations. this means you an update memory in one location and the changes can be seen from another location in your program. You will also save space by being able to share components in your data structures

Abstraction: Data abstraction refers to, providing only essential information to outside and hiding background details. To represent the needed info in program without presenting details. EX: C++ Provides different methods without giving full detail about those methods and its data

Encapsulation: Is placing the data and the functions that work on the data in the same place.Not always clear which functions work on the which variables but object-oriented programming provides yo framework to place the data and the relevant function together in same object.

tolower

Function that returns lowercase std::string str = "simple"; std::transform(ssbtr.begin(), str.end(), str.begin(), std::tolower);

+ . #include<fstream>

Header file for file Input./Output

+ . #include<cstdlib>

Header file for random

How memory works in C++:

How memory works in C++:

1.) Description P03: *Comments* Input: Output: Process:

Input: +Error Checking: Your program should not allow the user to enter an invalid column number. If the user enters an invalid column number, your program should ask the user to re-enter a column number. If the user chooses a column that is already full, your program needs to alert the user and ask him/her to choose a different column. Output: The Connect 4 game board should be implemented as a 2-D array of characters (or other data types). Initially, the board is filled with spaces in all the possible token areas, but will be filled by the players with Os and *s during play. You are free to choose your own tokens for play. Notice in the implementation at the end, Xs and Os were used. Process:

*Input*:

Input: The input will be read from a file. The first line of the file will contain an integer n which represents the number of words from the secret message that follow in the file. The user of the program will enter the filename from a prompt from your program. Here is an example: 6 dusty army sweat mary waste study Make sure you test your program with several sample files. For example, test a file where all of the words contain unique character sets and a file where all of the words use the same character set

DMA C++: Creating array dynamically int main(){ int size; int *ptr; cout<<"Enter number of values you want to store (size of array): " <<endl; cin>> size; //set pointer equal to new int with //offset operator ptr = new int[size]; //set size of array of pointers, //assigning cout<< "Enter values to be stored in the array"<<endl; //for loop takes in the values of array for(int i=0; i<size; i++){ cin >>ptr[i];; } return 0; }

Moral of the story is that with DMA you can create pointers during run time vs compile time. These dynamic arrays are very convenient and stored in heap.

NOTE: SCOPE OF VARIABLES IN FOR LOOP IS LIMITED! KEEP IN MIND

NOTE: SCOPE OF VARIABLES IN FOR LOOP IS LIMITED! KEEP IN MIND

Object Composition: Class can have objects another class.

Object Composition: Class can have objects another class.

[ ] Dereference Operator: *Offset Operator* V.S (D.O *) Equivalent: 1.) a[5]=0; 2.) *(a+5) = 0;

Offset operators dereference the variable they follow just like dereference variables! 1 & 2 are equivalent when 'a' is a pointer or array.

What is the output of: int foo(int a, int& b, int c[]) { a++; b= a+1; c[1]= c[0] +b; return a +b; } int main() { int x=3; int y=4; int z[3] = {7,4,2}; cout<<x<<" "<<y<<endl; foo(x,y,z); cout<<x<<" "<<y<<endl; cout<<z[0]<<" "<<z[1]<<" "<<z[2] <<endl; return 0; } What if the address-of operator is removed from function foo?

Output 1: Line: 1.) 3 4 2.) 3 5 3.) 7 12 2 Output 2: Line: 1.) 3 4 2.) 3 4 3.) 7 12 2

SLACK INSTRUCTIONS: OUTPUT:

Outputs: 1) A second worksheet is created with the correct answers to compare and check against the user's answers 2) Each individual problem (depending on if it's correct, incorrect, or not reduced) will be given a response from a randomly selected response from an array of correct/incorrect/not reduced responses (i.e. Correct, Incorrect, Great Job, Try Again, Not Reduced, Almost, etc...)

Pointers: 1.)Declaring data type of the data it points to, not the pointer itself: so it is type int* (int pointer) 2.)Initializing 3.)Deleting Pointers

POINTER ON STACK! pointer is on stack and will disappear when memory is freed. 1.) Create, Declare: int *myPointer = nullptr int *myPointer2 = nullptr Memory Adress on STACK! New (NAMELESS) Variable on HEAP! Allocates memory address of block in pointer ( a 4byte address) 2.)Initialize: myPointer = new Int[10000]; myPointer2 = new Int; Deallocates memory so other program can use space. Delete is called because integer no longer belongs there, and then setting pointer equal to null so it doesn't do a pointless point at the heap. 3.) Delete Memory and Heap and Set Pointer point to Null delete myPointer; (for Array: deleter[]myPointer;) myPointer = nullptr; PURPOSE: Whenever we want to allocate any array, variable, class on the heap.

POST FINAL EXAM:

POST FINAL EXAM:

SLACK INSTRUCTIONS: INPUT:

PROGRAMMING ASSIGNMENT #2: (use #include <cstdlib>).....srand(..) will be put at the top of main...rand() is how you generate a number Inputs: 1) once opened the program randomly produces a fraction worksheet in a file; 2) Ask the user how many problems they want to do; 3) User types in their answers into the fraction worksheet file 4) After submitting answers, the user has the option to pick whether he/she wants to check answers, quit the program, redo the SAME worksheet, or try another randomly generated worksheet (number of problems will be re-defined by the user again here)

*2 Final Questions* 2.) What are the headers of the .h file? Type1.) Essential .h headers Type2.)necessary packages for the parameters of creating object! *Type3.)* The usual essential Packages only used when involving package or object for members or parameters.

People.h Type 1: #ifdef PEOPLE_H #define PEOPLE_H VERY END }; #endif Type2: #include "Birthday.j" #include <cstring> Type3: #include <iostream> user namespace std;

Four important points for a good function?

Pre: Parameters: Return: Post:

Dereference operator(*) READ AS: "Value Pointed to by" baz = *foo; READ AS: ......................

READ AS: "baz equals value pointed to by foo"

*NOTE:Member Initializer Syntax:* +Special syntax for assigning values to members/variables of a class when a *variable is constant, or dealing with composition* +Don't write any code in body of constructors, put in between parameter list and the body.

Sally:: Sally(int a, int b) //colon then start list : regVar(a) , constVar(b) { } void Sally:: print(){ cout<< "regular var is: "<< regVar<<" const variable is: "<< constVar<<endl; }

Dangling Pointer: Pointer that has not been set to null after deleting address data in heap. *AVOID DANGLING POINTERS: A pointer that points into the abyss* int * p = . new int; *p = 5; delete p; How to avoid a dangling pointer?

Set pointer to null. 1.) p = nullptrl; Reassign the pointer to reference a different int. 2.) p = new int(#);

Address- of Operator (&) vs. Derefernce Operator(*) http://www.cplusplus.com/doc/tutorial/pointers/ Define the lines bellow? 1.) myvar=25; 2.)foo= &myvar; 3.)bar=myvar;

Similarities: + Are complementary! +Often used in the same context as a pointer since *a pointer is a variable which stores the address of another variable* Difference: + Address of operator accesses the address of variable. +*Pointers can access the variable they point to directly!* 1.) & 3.) standard assignment operation 2.) Pointer!

Classes/Objects: 1.) Declare class with whatever name is most appropriate 2.) Create Class "CLASS name;" 3.) To call functions: "name.functionName();" 4.) "private:" : variables within class accessible to only the functions within. "public:" : functions and constructors 5.) Constructor: Called automatically when declaring object. Only time you want to add parameters in constructors is to initialize certain variables. All constructors must have same name. 6.) Deconstructor: Always follows a tilde(~)

Syntax: Binary scope resolution operators(::): Designed to know what class the functions in source file belong to. datatype CName:: FName() {} Constors/Deconstructors: //Not void, no data type Sally::Sally(){} Sally::~Sally(){}

&: What is the difference between: cout<<x; cout<<&x;

The address-of operator (&) allows us to see what memory address is assigned to a variable. This is pretty straightforward: #include <iostream> int main() { int x = 5; cout << x <<endl; // prints value of variable x. cout << &x << '\n'; // prints memory address of // variable x. return 0; }

*Output:*

The first line of output will contain a statement of the number of unique character sets from the input file (see example below). Then the unique character sets will be displayed (in any order), but the characters should be in order based on their ordering in the alphabet. There were 3 unique character sets. dstuy amry aestw

FEEDBACK AND GRADE:

The problems in answer.txt are different than the worksheet. They are the reduced version of the problem instead of the original problem your program output: worksheet.txt: 1.)29/33+3/41= 2.)42/57-62/77= answers.txt: 1.)29/33+3/41=1288/1353 2.)14/19-62/77=-100/1463 I like that it checks if the answer needs to be simplified. Code looks pretty good. A few indentation errors Functionality: 45/50 Code Quality: 35/40 Comments: 10/10 Total: 90/100

#include<cstring>:

Used for char arrays.

Stack Smashing:

Writing to multTable[12][12] will write to memory outside of your function's stack space corrupting it. This is "stack smashing".

*NOTE: HEADERS & .H files* Header file(.h)= +Always ends with a semicolong and a #endif. Headers are used by customers or company with right, but valuable logic is kept by programer in source files. +Includes the function header (including data type) followed by semi colon. CLASS headers = MAIN headers

_____.cpp & main.cpp: #include <iostream> #include "____.h" using namespace std;

for() how to make it infinite?

for(;;) C programming tutorial- 47: infinite loop

Declaring/creating variables

int a;

Declare an array of 20 integers with the name data?

int data[20];

Create function that will raise first parameter to the power of second: NOTE: REMEMBER YOUR CRAFTY BW OPERATORS! DON'T OVERTHINK.

int raisePower(int a , int b) { int answer =a; for(int i =1; i<b;i++) { answer*=a; } return answer; }

Pointer Special Cases: +Setting a pointer to a pointer.

myPointer = new int; myPointer2= myPointer; *myPointer= 5; cout<< *myPointer<<endl; (Output: 5) *myPointer2 = 10; cout<< *myPointer<endl; (Output: 10) IF--------------------------- delete myPointer; delete myPointer2; (Compile Error, only delete one. Same variable deleted twice)

Memory Diagrams: 1.) Draw Stack and Heap 2.) Track pointers (number the order) 3.)Depict the deleting of pointers and the area of memory in heap.

p-> address *p-> accesses value 1.) 2.) 3.)garbage variables are depicted whenever the address in *p is deleted and all memory in the address is freed*. The pointer and address are seperate entities. *Pointer still pointing into the abyss so must be set to null*.

COMPOSITIONS: Main: Step 1: Create the object with the parameters necessary to define member variables. Birthday bo(#,#,#) Step2: Create the higher overarching object and pass the object1 as a parameter Person gRinal("Gian", bo); Step3: Print out desired outcome preferrably by calling the function of the second class, gRinal.print; for example check out printInfo in people.

void People:: printInfo(){ /*want on same line*/ cout<< name<< "was born on "; dateOfBirth.printDate(); }

NOTE:C++ has the following storage classes +static +automatic +dynamic +thread Roughly, dynamic corresponds to "heap", and automatic corresponds to "stack". A pointer can be created in any of these four storage classes; and objects being pointed to can also be in any of these storage classes. Some examples:

void func() { // automatic pointer to //dynamic object int *p = new int; // automatic object int q; // automatic pointer to //automatic object int *r = &q; // static pointer to //dynamic object static int *s = p; // static pointer to //automatic object (bad //idea) static int *s = r; // thread pointer to static //object thread_local int **t = &s; }

FEEDBACK AND GRADE:

your program: 0/1 + 1/1 ERROR: 0 in numerator. Is undefined, try again. 1/0 + 3/4 Fraction 1 is simply 0, so the answer is : 3/4 You have this logic backwards Functionality: 35/50 Code Quality: 40/40 Comments: 10/10 Total: 85/100

STEP 1: Converting character array to lower case tolower: putchar:

{ char c= tolower(buffer[j]); buffer[j]= c; }

*NOTE:* ~Delete: ~New: EX: int *p = new int(10); *( ) not [ ] *

~Delete: To deallocate memory on the heap ~new: allocate space dynamically on the heap( free store). the new returns the address of the allocated memory. Use pointers to reference the memory allocated on the heap.


संबंधित स्टडी सेट्स

BUSMHR 2500 Chapter 3 Generating and Exploiting New Entries

View Set

Market research and analysis exam 1

View Set

5 STEPS TO A 5: 500 Questions - Population (#43-63)

View Set

Vocabulary Unit 6 (English Plus 1)

View Set

Chapter 16: Anatomy of the Heart

View Set