cs31 lecture 17

Attributename x gettingsetting the value of am

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: should expose its specific data modifier functions You don’t have functions to write your neurons directly You 112 But… what is an object? x A class is a type x An object is an instance of a class x It has an internal state (attributes)
 x It has functions associated to it (methods)
 x There can be multiple objects of the same class in the There program program std::string foo; // a first object of type string std::string bar; // a second object of type string 113 What is a class? x A class is a type, and you can declare variable (objects)
 of class this type this x A class in OOP can have: Attributes (fields)
, to specify data to be attached to the class Methods (functions)
, that can operate on the data in the class, and Methods on external data on x A class in C++ can be declared with The keyword struct (all methods are public by default)
 The keyword class (all methods are private by default)
 114 More on the syntax x Declaring a class with all attributes/methods public: struct <classname> { [attributes declaration, methods prototyp...
View Full Document

This note was uploaded on 04/03/2014 for the course CS 31 taught by Professor Melkanoff during the Fall '00 term at UCLA.

Ask a homework question - tutors are online