Questions for Objective-C

Total Page:16

File Type:pdf, Size:1020Kb

Questions for Objective-C www.YoYoBrain.com - Accelerators for Memory and Learning Questions for Objective-C Category: Default - (44 questions) Objective-C: to create an object you send a alloc messageNSMutableArray ___ to a class *arrayInstance = [NSMutableArray alloc]; Objective-C: the first message you always init send to a newly allocated message is ____ Objective-C: normal way to combine alloc NSMutableArray *arrayInstance = and init when creating object [[NSMutableArray alloc] init] Objective-C: to destroy an object, send it the release message ____ Objective-C: what to do after [arrayInstance arrayInstance = nil; release] Objective-C: type of array that lets you add / NSMutableArray remove objects Objective-C: how to add an object to addObject NSMutableArray Objective-C: how to put an object in a [items insertObject:@"xx" atIndex] particular spot in NSMutableArray Objective-C: grab an object at particular objectAtIndex:count index in NSMutableArray Objective-C: how to send string output to log NSLog(@"my message"); Objective-C: the C language retains all its the @ prefix keywords and any keywords from Objective-C are distinguishable by ____ Objective-C: to declare a class, you use @interfacename of the new class keyword ___ followed by _____ Objective-C: how to declare getter / setter @property int fido; accessors to a variable (ex: int fido) Objective-C: how to control whether lock attribute atomic / nonatomic@property must be obtained to getter or setter variable (nonatomic) int something; with @property Objective-C: file type for implementation of .m extension for implementation file header declarations Objective-C: how to start and finish @implementation MyClass@end implementation of @interface in .m file Objective-C: how to declare a method is an - in first line of code- (NSString *) instance method (not class) description{} Objective-C: at top of implementation file import the header (.h) file of the class you always _____ Objective-C: how to invoke method in super [super method]; class Objective-C: how to reserve / return memory char *buffer = malloc(100);free(buffer); with C syntax Objective-C: what is malloc / free replaced malloc => allocfree => dealloc with in Objective-C Objective-C: you can mark an object for autorelease future release by sending it the message ______ Objective-C: how to increase a variable's retain message[d retain]; reference count Objective-C: how to decrease a variables [d release] reference count explicitly Objective-C: when using @property how to retain property@property (retain) Dog *pet; have compiler generate proper retain / release for memory management Objective-C: how to relinquish control of [myVar autorelease] object and allow it to be garbage collected when everyone else finished Objective-C: how to declare which protocol listing the names of the protocols in a a class conforms to comma delimited list in angle brackets after the name of the superclass@interface MyController: NSObject <UITextDelegate, SomeOtherDelegate> Objective-C: terminology for interfaces protocols Objective-C: how to declare methods in @optional -method1; -method2; protocol that are not required Objective-C: define a retain cycle when a child retains a reference to a parent, prevent parent from responding to release call Objective-C: define - blocks language level feature added to C, Objective-C and C++, which allow creation of distinct segments of code that can be passed around to methods or functions as if they were values. Similar to lambdas or closures in other languages Objective-C: syntax to define a block literal use the caret ^ symbol^{ NSLog(@"This is a block"); } Objective-C: syntax to declare a variable to void (^simpleBlock)(void); keep track of a block Objective-C: how to declare a block that ^double (double firstValue, double takes 2 doubles and returns a double secondValue) { return firstValue*secondvalue;} Objective-C: syntax to allow the changing of use _ block storage type modifier_block int a captured variable from within the block anInteger=42; Objective-C: meaning of syntax in expected (void (^)(void)) specifies a block that doesn't parameter-(void) take any segments or return any values beginTaskWithCallbackBloc(void (^)(void)) ... { } Objective-C: 2 main task-scheduling operation queuesGrand Central Dispatch mechanisms are _____ and ____ Objective-C: For operation queues ____ NSOperationNSOperationQueue object to create an instance to encapsulate a unit of work, and then add that operation to ____ for execution Objective-C: Use ___ to create an operation NSBlockOperation using a block Objective-C: If you need to schedule an dispatch queuesGrand Central Dispatch arbitrary block of code for execution, you can (GCD) work directly with ____ controlled by ______ Objective-C: how to get a reference to dispatch_get_global_queue existing queue using GCD Objective-C: to dispatch a block to a GCD dispatch_asynch()dispatch_synch() queue Objective-C: class for creating Queue NSInvocationOperation operation that you use as-is to create an operation based on an object and selector from your application Objective-C: define - selector name used to select a method to execute for an object, or the unique identifier that replaces the name when the source code is compiled Category: Extensions to C - (16 questions) XCode - shortcut to pull up the XCode Cmd - Shift - R console window for standard i/o Objective-C: file extension for source code .m Objective-C: how to include header files #import <Foundation/Foundation.h> Objective-C: Logs an error message to the NSLog( NSString ); Apple System Log facility Objective-C: how to designate a string literal @"my string" Objective-C: type for a sequence of NSString characters in Cocoa Objective-C: type for boolean value BOOL Objective-C: syntax for sending a message [ object, action] to an object Objective-C: how to define an interface @interface name : superClass{ type data1; type data2;} Objective-C: syntax for method declarations - (returnType) methodName: (type) var1, ... ; for interfaces Objective-C: syntax for implementation of @implementation className@end class Objective-C: syntax to create a class [className new] Objective-C: method that gets called when init new object is created Objective-C: syntax for getter and setter for prop1- (Type *) prop1;- (void) setProp1: methods (Type *) newProp1; Objective-C: syntax for getter / setters for - void setTire: (Tire *) tire atIndex: (int) property that is array - like Tire *tires[4] index;- (Tire *) tireAtIndex: (int) index; Objective-C: syntax for not importing a @class className; class but saying we are referring to it via a pointer Category: Xcode - (14 questions) Objective-C: Xcode shortcut to open a Command - Option - Shift - D import source file Objective-C: Xcode shortcut to add a book Command D mark Objective-C: Xcode shortcut to show the Esc completion menu Objective-C: Xcode shortcut to cycle forward Control . (period)Shift Control . (period) / backward through the code completions Objective-C: Xcode how to search Option - Double Click documentation for keyword Objective-C: Xcode shortcut to run the Command Y program with debugger Objective-C: what is NSRange struct used to represent a range of things, characters in a string or items in an arrayunsigned int location;unsigned in length; Objective-C: how to create a NSRange NSRange range = {17, 4};NSRange range = NSMakeRange (17, 4); Objective-C: syntax to created a formatted [NSString stringWithFormat: @"Your height string with variables is %d feed, %d inches", 5, 11] Objective-C: syntax to create a class + (id) myFunction: .....starts with plus sign method Objective-C: how to get length of string [myString length] Objective-C: how to compare strings for - (BOOL) isEqualToString: (NSString *) equality aString; Objective-C: how to compare a string - (NSComparisonResult) compare: (NSString character by character to another *) string; Objective-C: 3 string comparison methods - (BOOL) hasPrefix: (NSString *) aString;- to search for substrings (BOOL) hasSuffix: (NSString *) aString;- (NSRange) rangeOfString: (NSString *) aString; Category: Foundation Kit - (12 questions) Objective-C: class for mutable strings NSMutableString Objective-C: syntax to create a mutable + (id) stringWithCapacity: (unsigned) string with initial capacity of 50 capacity; Objective-C: class for ordered list of objects NSArray Objective-C: how to create an NSArray with [NSArray arrayWithObjects: @"one", @"two", initial objects @"three", nil]; Objective-C: how to fetch an object at an - (id) objectAtIndex: (unsigned int) index; index from NSArray Objective-C: array class that can have NSMutableArray mutable number of objects Objective-C: class used for iteration over a NSEnumerator collection Objective-C: how to get a NSEnumerator - (NSEnumerator *) objectEnumerator; from NSArray object Objective-C: syntax for fast enumeration for (NSString *string in array) {} Objective-C: object with key / value map NSDictionary Objective-C: class used to put structures NSValue into NSArrays Objective-C: class to represent nil values NSNull Category: Memory Management - (16 questions) Objective-C: basic pattern for accessor - (void) setXxx: (Xxx *) newXxx{ [newXxx memory management when using objects retain]; [Xxx release]; Xxx = newXxx;} Objective-C: method call to put a memory - (id) autorelease; release into the NSAutoreleasePool Objective-C: OS X 10.4 and higher - (init) drain NSAutoreleasePool method for issuing a pool release without destroying pool Objective-C: older method for removing all [pool release]; memory
Recommended publications
  • Preview Objective-C Tutorial (PDF Version)
    Objective-C Objective-C About the Tutorial Objective-C is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. This is the main programming language used by Apple for the OS X and iOS operating systems and their respective APIs, Cocoa and Cocoa Touch. This reference will take you through simple and practical approach while learning Objective-C Programming language. Audience This reference has been prepared for the beginners to help them understand basic to advanced concepts related to Objective-C Programming languages. Prerequisites Before you start doing practice with various types of examples given in this reference, I'm making an assumption that you are already aware about what is a computer program, and what is a computer programming language? Copyright & Disclaimer © Copyright 2015 by Tutorials Point (I) Pvt. Ltd. All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book can retain a copy for future reference but commercial use of this data is not allowed. Distribution or republishing any content or a part of the content of this e-book in any manner is also not allowed without written consent of the publisher. We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or in this tutorial, please notify us at [email protected] ii Objective-C Table of Contents About the Tutorial ..................................................................................................................................
    [Show full text]
  • Analyzing Safari 2.X Web Browser Artifacts Using SFT
    Analyzing Safari 2.x Web Browser Artifacts using SFT. Copyright 2007 - Jacob Cunningham (v1.0) Table of Contents Introduction:...............................................................................................................................................3 Safari Forensic Tools................................................................................................................................. 3 OSX Property List files..............................................................................................................................3 Safari Related Files.................................................................................................................................... 4 The Safari Preferences files....................................................................................................................... 5 Browser History......................................................................................................................................... 7 Downloads history:.................................................................................................................................... 8 Bookmarks file ........................................................................................................................................10 Cookies file:............................................................................................................................................. 11 Browser Cache........................................................................................................................................
    [Show full text]
  • Strings in C++
    Programming Abstractions C S 1 0 6 X Cynthia Lee Today’s Topics Introducing C++ from the Java Programmer’s Perspective . Absolute value example, continued › C++ strings and streams ADTs: Abstract Data Types . Introduction: What are ADTs? . Queen safety example › Grid data structure › Passing objects by reference • const reference parameters › Loop over “neighbors” in a grid Strings in C++ STRING LITERAL VS STRING CLASS CONCATENATION STRING CLASS METHODS 4 Using cout and strings int main(){ int n = absoluteValue(-5); string s = "|-5|"; s += " = "; • This prints |-5| = 5 cout << s << n << endl; • The + operator return 0; concatenates strings, } and += works in the way int absoluteValue(int n) { you’d expect. if (n<0){ n = -n; } return n; } 5 Using cout and strings int main(){ int n = absoluteValue(-5); But SURPRISE!…this one string s = "|-5|" + " = "; doesn’t work. cout << s << n << endl; return 0; } int absoluteValue(int n) { if (n<0){ n = -n; } return n; } C++ string objects and string literals . In this class, we will interact with two types of strings: › String literals are just hard-coded string values: • "hello!" "1234" "#nailedit" • They have no methods that do things for us • Think of them like integer literals: you can’t do "4.add(5);" //no › String objects are objects with lots of helpful methods and operators: • string s; • string piece = s.substr(0,3); • s.append(t); //or, equivalently: s+= t; String object member functions (3.2) Member function name Description s.append(str) add text to the end of a string s.compare(str) return
    [Show full text]
  • Variable Feature Usage Patterns in PHP
    Variable Feature Usage Patterns in PHP Mark Hills East Carolina University, Greenville, NC, USA [email protected] Abstract—PHP allows the names of variables, classes, func- and classes at runtime. Below, we refer to these generally as tions, methods, and properties to be given dynamically, as variable features, and specifically as, e.g., variable functions expressions that, when evaluated, return an identifier as a string. or variable methods. While this provides greater flexibility for programmers, it also makes PHP programs harder to precisely analyze and understand. The main contributions presented in this paper are as follows. In this paper we present a number of patterns designed to First, taking advantage of our prior work, we have developed recognize idiomatic uses of these features that can be statically a number of patterns for detecting idiomatic uses of variable resolved to a precise set of possible names. We then evaluate these features in PHP programs and for resolving these uses to a patterns across a corpus of 20 open-source systems totaling more set of possible names. Written using the Rascal programming than 3.7 million lines of PHP, showing how often these patterns occur in actual PHP code, demonstrating their effectiveness at language [2], [3], these patterns work over the ASTs of the statically determining the names that can be used at runtime, PHP scripts, with more advanced patterns also taking advantage and exploring anti-patterns that indicate when the identifier of control flow graphs and lightweight analysis algorithms for computation is truly dynamic. detecting value flow and reachability. Each of these patterns works generally across all variable features, instead of being I.
    [Show full text]
  • Strings String Literals String Variables Warning!
    Strings String literals • Strings are not a built-in data type. char *name = "csc209h"; printf("This is a string literal\n"); • C provides almost no special means of defining or working with strings. • String literals are stored as character arrays, but • A string is an array of characters you can't change them. terminated with a “null character” ('\0') name[1] = 'c'; /* Error */ • The compiler reserves space for the number of characters in the string plus one to store the null character. 1 2 String Variables Warning! • arrays are used to store strings • Big difference between a string's length • strings are terminated by the null character ('\0') and size! (That's how we know a string's length.) – length is the number of non-null characters • Initializing strings: currently present in the string – char course[8] = "csc209h"; – size if the amount of memory allocated for – char course[8] = {'c','s','c',… – course is an array of characters storing the string – char *s = "csc209h"; • Eg., char s[10] = "abc"; – s is a pointer to a string literal – length of s = 3, size of s = 10 – ensure length+1 ≤ size! 3 4 String functions Copying a string • The library provides a bunch of string char *strncpy(char *dest, functions which you should use (most of the char *src, int size) time). – copy up to size bytes of the string pointed to by src in to dest. Returns a pointer to dest. $ man string – Do not use strcpy (buffer overflow problem!) • int strlen(char *str) – returns the length of the string. Remember that char str1[3]; the storage needed for a string is one plus its char str2[5] = "abcd"; length /*common error*/ strncpy(str1, str2, strlen(str2));/*wrong*/ 5 6 Concatenating strings Comparing strings char *strncat(char *s1, const char *s2, size_t n); int strcmp(const char *s1, const char *s2) – appends the contents of string s2 to the end of s1, and returns s1.
    [Show full text]
  • Building an Openstep Application by Michael Rutman, Independent Consultant
    Building an OpenStep Application by Michael Rutman, independent consultant Is it really as easy to program in OpenStep OpenStep and NEXTSTEP In 1985, Steve Jobs left Apple and formed NeXT. He found the latest technologies and brought together a team of developers to turn the newest theories into realities. To verify the new technologies, during development Steve would often stop development and have the entire team use the system they were creating. Several existing apps were created during these day or week long kitchens. More importantly, each developer knew how the framework would be used. If developers had a hard time using an object during a kitchen, they knew they had to rework that object. The system they created was called NEXTSTEP. NEXTSTEP has several layers, and each layer was state of the art in 1985. In the 12 years since Steve picked these technologies, the state of the art may have moved, but not advanced. The underlying OS is a Mach mini-kernel running a unix emulator. For practical purposes, Mach is a flavor of BSD unix. However, the Mach mini-kernel offers programmers a rich set of functionality beyond what unix provides. Most of the functionality of Mach is wrapped into the NEXTSTEP framework, so programmers get the power and flexibility of Mach with the ease of use of NEXTSTEP. Sitting on top of Mach is Display Postscript. Postscript, the language of printers, is a nice graphics language. NeXT and Adobe optimized Postscript for displaying on the screen and produced a speedy and powerful display system. NeXT's framework hides most of the Postscript, but if a programmer wants to get into the guts, there are hooks, called pswraps, to work at the Postscript level.
    [Show full text]
  • Using the Java Bridge
    Using the Java Bridge In the worlds of Mac OS X, Yellow Box for Windows, and WebObjects programming, there are two languages in common use: Java and Objective-C. This document describes the Java bridge, a technology from Apple that makes communication between these two languages possible. The first section, ÒIntroduction,Ó gives a brief overview of the bridgeÕs capabilities. For a technical overview of the bridge, see ÒHow the Bridge WorksÓ (page 2). To learn how to expose your Objective-C code to Java, see ÒWrapping Objective-C FrameworksÓ (page 9). If you want to write Java code that references Objective-C classes, see ÒUsing Java-Wrapped Objective-C ClassesÓ (page 6). If you are writing Objective-C code that references Java classes, read ÒUsing Java from Objective-CÓ (page 5). Introduction The original OpenStep system developed by NeXT Software contained a number of object-oriented frameworks written in the Objective-C language. Most developers who used these frameworks wrote their code in Objective-C. In recent years, the number of developers writing Java code has increased dramatically. For the benefit of these programmers, Apple Computer has provided Java APIs for these frameworks: Foundation Kit, AppKit, WebObjects, and Enterprise Objects. They were made possible by using techniques described later in Introduction 1 Using the Java Bridge this document. You can use these same techniques to expose your own Objective-C frameworks to Java code. Java and Objective-C are both object-oriented languages, and they have enough similarities that communication between the two is possible. However, there are some differences between the two languages that you need to be aware of in order to use the bridge effectively.
    [Show full text]
  • Openstep User Interface Guidelines
    OpenStep User Interface Guidelines 2550 Garcia Avenue Mountain View, CA 94043 U.S.A. Part No: 802-2109-10 A Sun Microsystems, Inc. Business Revision A, September 1996 1996 Sun Microsystems, Inc. 2550 Garcia Avenue, Mountain View, California 94043-1100 U.S.A. All rights reserved. Portions Copyright 1995 NeXT Computer, Inc. All rights reserved. This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Portions of this product may be derived from the UNIX® system, licensed from UNIX System Laboratories, Inc., a wholly owned subsidiary of Novell, Inc., and from the Berkeley 4.3 BSD system, licensed from the University of California. Third-party font software, including font technology in this product, is protected by copyright and licensed from Sun's suppliers. This product incorporates technology licensed from Object Design, Inc. RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR 52.227-19. The product described in this manual may be protected by one or more U.S. patents, foreign patents, or pending applications. TRADEMARKS Sun, Sun Microsystems, the Sun logo, SunSoft, the SunSoft logo, Solaris, SunOS, and OpenWindows are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
    [Show full text]
  • VSI Openvms C Language Reference Manual
    VSI OpenVMS C Language Reference Manual Document Number: DO-VIBHAA-008 Publication Date: May 2020 This document is the language reference manual for the VSI C language. Revision Update Information: This is a new manual. Operating System and Version: VSI OpenVMS I64 Version 8.4-1H1 VSI OpenVMS Alpha Version 8.4-2L1 Software Version: VSI C Version 7.4-1 for OpenVMS VMS Software, Inc., (VSI) Bolton, Massachusetts, USA C Language Reference Manual Copyright © 2020 VMS Software, Inc. (VSI), Bolton, Massachusetts, USA Legal Notice Confidential computer software. Valid license from VSI required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. The information contained herein is subject to change without notice. The only warranties for VSI products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. VSI shall not be liable for technical or editorial errors or omissions contained herein. HPE, HPE Integrity, HPE Alpha, and HPE Proliant are trademarks or registered trademarks of Hewlett Packard Enterprise. Intel, Itanium and IA64 are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. Java, the coffee cup logo, and all Java based marks are trademarks or registered trademarks of Oracle Corporation in the United States or other countries. Kerberos is a trademark of the Massachusetts Institute of Technology.
    [Show full text]
  • Strings String Literals Continuing a String Literal Operations on String
    3/4/14 String Literals • A string literal is a sequence of characters enclosed within double quotes: "When you come to a fork in the road, take it." Strings • String literals may contain escape sequences. • Character escapes often appear in printf and scanf format strings. Based on slides from K. N. King and Dianna Xu • For example, each \n character in the string "Candy\nIs dandy\nBut liquor\nIs quicker.\n --Ogden Nash\n" causes the cursor to advance to the next line: Bryn Mawr College Candy CS246 Programming Paradigm Is dandy But liquor Is quicker. --Ogden Nash Continuing a String Literal How String Literals Are Stored • The backslash character (\) • The string literal "abc" is stored as an array of printf("When you come to a fork in the road, take it. \ four characters: --Yogi Berra"); Null o In general, the \ character can be used to join two or character more lines of a program into a single line. • When two or more string literals are adjacent, the compiler will join them into a single string. • The string "" is stored as a single null character: printf("When you come to a fork in the road, take it. " "--Yogi Berra"); This rule allows us to split a string literal over two or more lines How String Literals Are Stored Operations on String Literals • Since a string literal is stored as an array, the • We can use a string literal wherever C allows a compiler treats it as a pointer of type char *. char * pointer: • Both printf and scanf expect a value of type char *p; char * as their first argument.
    [Show full text]
  • Data Types in C
    Princeton University Computer Science 217: Introduction to Programming Systems Data Types in C 1 Goals of C Designers wanted C to: But also: Support system programming Support application programming Be low-level Be portable Be easy for people to handle Be easy for computers to handle • Conflicting goals on multiple dimensions! • Result: different design decisions than Java 2 Primitive Data Types • integer data types • floating-point data types • pointer data types • no character data type (use small integer types instead) • no character string data type (use arrays of small ints instead) • no logical or boolean data types (use integers instead) For “under the hood” details, look back at the “number systems” lecture from last week 3 Integer Data Types Integer types of various sizes: signed char, short, int, long • char is 1 byte • Number of bits per byte is unspecified! (but in the 21st century, pretty safe to assume it’s 8) • Sizes of other integer types not fully specified but constrained: • int was intended to be “natural word size” • 2 ≤ sizeof(short) ≤ sizeof(int) ≤ sizeof(long) On ArmLab: • Natural word size: 8 bytes (“64-bit machine”) • char: 1 byte • short: 2 bytes • int: 4 bytes (compatibility with widespread 32-bit code) • long: 8 bytes What decisions did the designers of Java make? 4 Integer Literals • Decimal: 123 • Octal: 0173 = 123 • Hexadecimal: 0x7B = 123 • Use "L" suffix to indicate long literal • No suffix to indicate short literal; instead must use cast Examples • int: 123, 0173, 0x7B • long: 123L, 0173L, 0x7BL • short:
    [Show full text]
  • The ASCII Character Set Strings and Characters
    Characters and Strings 57:017, Computers in Introduction Engineering—Quick Review Fundamentals of Strings and Characters of C Character Strings Character Handling Library String Conversion Functions Standard Input/Output Library Functions String Manipulation Functions of the String Handling Library Comparison Functions of the String Handling Library Search Functions of the String Handling Library Other Functions of the String Handling Library Fundamentals of Strings Introduction and Characters z Introduce some standard library functions z Characters z Easy string and character processing z Character constant z Programs can process characters, strings, lines of z represented as a character in single quotes text, and blocks of memory z 'z' represents the integer value of z z stored in ASCII format ((yone byte/character) z These techniques used to make: z Strings z Word processors z Series of characters treated as a single unit z Can include letters, digits and special characters (*, /, $) z Page layout software z String literal (string constant) - written in double quotes z Typesetting programs z "Hello" z etc. z Strings are arrays of characters z The type of a string is char * i.e. “pointer to char” z Value of string is the address of first character The ASCII Character Set Strings and Characters z String declarations z Declare as a character array or a variable of type char * char color[] = "blue"; char *colorPtr = "blue"; z Remember that strings represented as character arrays end with '\0' z color has 5 eltlements z Inputting strings z Use scanf char word[10]; scanf("%s", word); z Copies input into word[] z Do not need & (because word is a pointer) z Remember to leave room in the array for '\0' 1 Chars as Ints Inputting Strings using scanf char word[10]; z Since characters are stored in one-byte ASCII representation, char *wptr; they can be considered as one-byte integers.
    [Show full text]