Sponsored Content
Top Forums Programming Writing C++ class and member functions Post 302637489 by Corona688 on Wednesday 9th of May 2012 01:21:37 AM
Old 05-09-2012
You can call the functions, variables, and parameters whatever you want, as long as they don't overlap. They can't be all the same because, at best, some won't be available to you inside the function, at worst you'll get compiler errors in some contexts.

Beyond that I still have no idea what you're asking.
 

10 More Discussions You Might Find Interesting

1. Programming

writing functions

I have to write a program in C++ using several functions. The program consists of ticket sales how many if you are an adult, junior, or toddler and if there are any discounts. I have the program working up to the pricing function. when i put the discount in the equation it <strike>do</strike>... (1 Reply)
Discussion started by: ravenswind35
1 Replies

2. Programming

Handling a signal with a class member function

Hello, i am using the sigaction function to handle the SIGCHLD signal.Is it possible to use a class member function as the handler function (the sa_handler member of the sigaction structure)? The function's signature is: void (*sa_handler)(int);so i don't think i can use a static member function... (2 Replies)
Discussion started by: Zipi
2 Replies

3. UNIX for Dummies Questions & Answers

car class (not school class)

im just trying to have some fun and kill some time writing a c++ program that has a person type in a car make and model then gives them a year and a price. or something like that. i always have problems getting it goin but once the ball is rolling im usually pretty good. anyone wanna help me out? ... (1 Reply)
Discussion started by: rickym2626
1 Replies

4. Programming

C++ class definition with a member of the same class

Hi, i have a question about C++. Is it possible to declare a class with a member ot the same class? For example, a linked list or i want to convert this C code to C++ class (Elemento) typedef struct elemento { char name; char value; List<struct elemento> ltElementos; ... (7 Replies)
Discussion started by: pogdorica
7 Replies

5. Programming

static use for class inside the same class c++

Hi, I believe the next code is wrong: class Egg { Egg e; int i; Egg(int ii=0) : i(ii) {} }; because you would end up with an endless definition (memory allocation) of Egg objects, thus int i. Ok, so God Eckel proposes for a singleton: class Egg { static Egg e; int... (5 Replies)
Discussion started by: xavipoes
5 Replies

6. Shell Programming and Scripting

How to execute functions or initiate functions as command line parameters for below requirement?

I have 7 functions those need to be executed as command line inputs, I tried with below code it’s not executing function. If I run the ./script 2 then fun2 should execute , how to initiate that function I tried case and if else also, how to initiate function from command line if then... (8 Replies)
Discussion started by: saku
8 Replies

7. UNIX for Advanced & Expert Users

Get pointer for existing device class (struct class) in Linux kernel module

Hi all! I am trying to register a device in an existing device class, but I am having trouble getting the pointer to an existing class. I can create a class in a module, get the pointer to it and then use it to register the device with: *cl = class_create(THIS_MODULE, className);... (0 Replies)
Discussion started by: hdaniel@ualg.pt
0 Replies

8. Programming

Size of Derived class, upon virtual base class inheritance

I have the two class definition as follows. class A { public: int a; }; class B : virtual public A{ }; The size of class A is shown as 4, and size of class B is shown as 16. Why is this effect ?. (2 Replies)
Discussion started by: techmonk
2 Replies

9. Programming

Restricting member of a class non-inheritable in C++

There is base class B, and two derived classes D1 and D2 derived from Base. Base class B, have two data members ( public or protected or private or if any). D1 should inherit both these data members, and D2 should be deriving only one member from Base class. Is this kind of design possible without... (1 Reply)
Discussion started by: techmonk
1 Replies

10. Programming

C++ : Base class member function not accessible from derived class

Hello All, I am a learner in C++. I was testing my inheritance knowledge with following piece of code. #include <iostream> using namespace std; class base { public : void display() { cout << "In base display()" << endl; } void display(int k) {... (2 Replies)
Discussion started by: anand.shah
2 Replies
TERMINFO(3)						   BSD Library Functions Manual 					       TERMINFO(3)

NAME
setupterm, set_curterm, del_curterm, termname, longname, tigetflag, tigetnum, tigetstr, tparm, tputs, putp -- terminal independent operation routines LIBRARY
Terminal Information Library (libterminfo, -lterminfo) SYNOPSIS
#include <term.h> char PC; short ospeed; TERMINAL *cur_term; int setupterm(const char *name, int fildes, int *errret); TERMINAL * set_curterm(TERMINAL *nterm); int del_curterm(TERMINAL *oterm); char * termname(void); char * longname(void); int tigetnum(const char *id); int tigetflag(const char *id); char * tigetstr(const char *id); char * tparm(const char *cm, long p1, long p2, long p3, long p4, long p5, long p6, long p7, long p8, long p9); int tputs(const char *cp, int affcnt, int (*outc)(int)); int putp(const char *cp); int ti_setupterm(TERMINAL **, const char *name, int fildes, int *error); int ti_getflag(const TERMINAL *, const char *id); int ti_getnum(const TERMINAL *, const char *id); const char * ti_getstr(const TERMINAL *, const char *id); char * tiparm(const char *cm, ...); char * ti_tiparm(TERMINAL *, const char *cm, ...); int ti_puts(const TERMINAL *term, const char *str, int affcnt, int (*outc)(int, void *)); int ti_putp(const TERMINAL *term, const char *str); DESCRIPTION
These functions extract and use capabilities from a terminal capability database, usually /usr/share/misc/terminfo, the format of which is described in terminfo(5). These are low level routines; see curses(3) for a higher level package. The setupterm() function extracts the entry for terminal name and then calls set_curterm() to set cur_term to it. If name is NULL then it is replaced by the environment variable TERM. The setupterm() function returns 0 on success and -1 on error. errret is set to -1 if the terminfo database could not be opened, 0 if the terminal could not be found in the database, and 1 if all went well. The set_curterm() function sets the variable cur_term to nterm and makes all of the terminfo boolean, numeric and string variables use the values from nterm. The global variables PC and ospeed are then set. The old value of cur_term is returned. The del_curterm() function frees space pointed to by oterm. The termname() function returns the name of cur_term. The longname() function returns the description of cur_term. The tigetflag() function gets the boolean value of capability id, returning -1 if it is not a valid capability. The tigetnum() function gets the numeric value of the capability id, returning -2 if it is not a valid capability. The tigetstr() function returns the string value of the capability id, returning (char *)-1 if it is not a valid capability. The tparm() function returns a string decoded from cm with the parameters p1 ... p9 applied. Some capabilities require string parameters and only platforms that can fit a char * pointer inside a long can use them. For platforms which don't support this, NULL is returned and errno is set to ENOTSUPP. The string encoding and parameter application is described in terminfo(5). The tputs() function applies padding information to the string cp; affcnt gives the number of lines affected by the operation, or 1 if this is not applicable; outc is a function which is called by each character in turn. The external variable ospeed controls how many padding characters are sent in relation to the terminal speed. The putp() function calls tputs(str, 1, putchar). The output from putp() always goes to stdout. NetBSD Extensions To Terminfo The tiparm() function allows variadic parameters instead of 9 fixed longs. Numeric parameters must be passed as int. String parameters must be passed as char * and works on all platforms, unlike tparm(). The ti_*() functions correspond to the standard t*() functions but take an additional TERMINAL * parameter so that the terminal can be speci- fied instead of assuming cur_term. These functions use private variables to the TERMINAL instead of the global variables, such as PC and ospeed. SEE ALSO
ex(1), curses(3), terminfo(5) AUTHORS
Roy Marples <roy@NetBSD.org> BSD
January 25, 2013 BSD
All times are GMT -4. The time now is 10:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy