EasyManuals Logo

Casio ClassPad 300 Programming Guide

Casio ClassPad 300
125 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #100 background imageLoading...
Page #100 background image
OBCD x;
Cal_setpi_OBC(&x);
CPString pi(x, 10); // pi=”3.14159265”
CPString Comparison
The comparison operators == and != are defined as:
int operator==(const CPString& y);
int operator!=(const CPString& y);
The Standard C function strcmp is also available by using these functions:
int Compare(const CPString& y) const;
int Compare(PEGCHAR * lpsz) const;
Here is an example that uses these functions:
int i;
if(str2 == str3)
{
if(str1 != str2)
{
i = str2.Compare("this will fail");
}
}
Useful String Functions
The CPString class comes with a variety of string functions that will allow you to
manipulate a string in many different ways.
First of all, if you need to know the value of a character at a certain index, the []
operator is defined so that the following code is valid:
CPString str;
str = “test”;
CP_CHAR c = str[1]; // c is ‘e’
You can also retrieve the raw text buffer with any of the following three functions:
const PEGCHAR* Text();
operator LPPEGCHAR();
PEGCHAR *GetBuffer();
Be aware that the pointer returned by these functions is temporary and should never be
saved or modified. This buffer can become invalid when other CPString members are
called (like += etc) or when the object goes out of scope
Another common request is for the length of a string. The follow functions help get a
string’s length:
100

Table of Contents

Other manuals for Casio ClassPad 300

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Casio ClassPad 300 and is the answer not in the manual?

Casio ClassPad 300 Specifications

General IconGeneral
BrandCasio
ModelClassPad 300
CategoryCalculator
LanguageEnglish

Related product manuals