Sponsored Content
Top Forums Programming Class Pointer initialization C++ Post 302519619 by mind@work on Wednesday 4th of May 2011 11:47:39 AM
Old 05-04-2011
I thought they are same in the sense that :

point = 0; //intializes the pointer to zero value and

point = new ClassA(); //intializes the pointer sm memory bt. not any value means zero value
 

10 More Discussions You Might Find Interesting

1. Programming

Struct Initialization

Hi We are using a code generator for initializing structures with the #define macro. Compiling it with the GCC 2.8.1 (with -ansi) it OK. But when we are using the SUN C 5.0 compiler it screams. Following is a code sample: #include <stdlib.h> #include <stdio.h> typedef struct TEST3 {... (4 Replies)
Discussion started by: amatsaka
4 Replies

2. Programming

pass a pointer-to-pointer, or return a pointer?

If one wants to get a start address of a array or a string or a block of memory via a function, there are at least two methods to achieve it: (1) one is to pass a pointer-to-pointer parameter, like: int my_malloc(int size, char **pmem) { *pmem=(char *)malloc(size); if(*pmem==NULL)... (11 Replies)
Discussion started by: aaronwong
11 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

Pointer for class not working that well. Syntax I think.

I'll be gratefull for any help. Thanks. :) This is the non class type error: # g++ -I/usr/include/mysql -I/usr/include/mysql++ -lmysqlpp -L/usr/lib/mysql -L/usr/local/lib/mysql++ loaddsgsports.cpp -o loaddsgsports loaddsgsports.cpp: In function âint outputToImport(const char*, const char*,... (1 Reply)
Discussion started by: sepoto
1 Replies

6. 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

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

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

10. Programming

Array initialization inside class in C++

const int VALUES = {7,4,2,1,0}; //or int VALUES = {7,4,2,1,0};this statement inside a class definition gives error. Why? (3 Replies)
Discussion started by: milhan
3 Replies
scsi_ext_sense_fields(9F)				   Kernel Functions for Drivers 				 scsi_ext_sense_fields(9F)

NAME
scsi_ext_sense_fields, scsi_sense_info_uint64, scsi_sense_cmdspecific_uint64 - retrieve fields from SCSI sense data SYNOPSIS
#include <sys/scsi/scsi.h> void scsi_ext_sense_fields(uint8_t *sense_buffer, int *sense_buf_len, uint8_t **information, uint8_t **cmd_spec_info, uint8_t **fru_code, uint8_t **sk_specific, uint8_t **stream_flags); boolean_t scsi_sense_info_uint64(uint8_t *sense_buffer, int sense_buf_len, uint64_t *information); boolean_t scsi_sense_cmdspecific_uint64(uint8_t *sense_buffer, int sense_buf_len, uint64_t *cmd_spec_info); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
sense_buffer Pointer to a buffer containing SCSI sense data. The sense data is expected in wire format starting at the response code. It can be in either a fixed or descriptor format. information For scsi_ext_sense_fields(), this is a call-by-reference pointer to uint8_t. A pointer to the INFORMATION field in the sense data may be returned in this parameter. The scsi_sense_info_uint64() function requires a pointer to uint64_t. The data in the information field is returned as a 64 bit integer. If the sense data information field is 32 bits, fixed format, the most significant 32-bits are 0. cmd_spec_info For scsi_ext_sense_fields(), this is a call-by-reference pointer to uint8_t. A pointer to the COMMAND_SPECIFIC INFORMATION field in the sense data can be returned in this parameter. The scsi_sense_cmdspecific_uint64() function requires a pointer to uint64_t. The data in the command specific information field is returned as a 64 bit integer. If the sense data command specific information field is 32 bits, fixed format, the most significant 32-bits are 0. fru_code Call-by-reference pointer to uint8_t. A pointer to the FIELD REPLACEABLE UNIT CODE field in the sense data can be returned in this parameter. sk_specific Call-by-reference pointer to uint8_t. A pointer to the SENSE KEY SPECIFIC field in the sense data can be returned in this parameter. stream_flags Call-by-reference pointer to uint8_t. A pointer to the byte containing the ILI, EOM, and FILEMARK flags can be returned in this parameter. DESCRIPTION
The scsi_ext_sense_fields() function can be used to retrieve any of the extended sense data fields from a sense data buffer, regardless of whether the sense data is in fixed format or in descriptor format. The information, cmd_spec_info, fru_code, sk_specific, and stream_specific parameters are all call-by-reference output parameters. Each parameter corresponds to one or more of the extended sense data fields. Any of these parameters can be passed as NULL if the caller is not interested in the associated data. If the requested data is present and valid for each output parameter, the pointer passed in is set to point to the relevant location in the sense buffer. If the data is not present or invalid, the pointer is set to NULL. For example, a caller that requests a pointer to the information field would get NULL when an information descriptor is not present for descriptor format sense data or when the valid bit is not set for fixed format sense data. The information and command specific information fields can be 4 bytes or 8 bytes in length, depending on whether the sense data is in fixed or descriptor format respectively. Drivers can use scsi_validate_sense(9F) to determine the sense data format and, by extension, the length of the information and command specific information fields. A driver can determine whether integer data is included in the information or command specific information fields based on the asc and ascq sense keys, such as the LBA of a failed disk request. The scsi_sense_info_uint64() function retrieves the contents of the information field as a 64 bit integer and the scsi_sense_cmdspecific_uint64() retrieves the command specific information field as a 64 bit integer. Drivers should use scsi_validate_sense(9F) to ensure that the sense buffer contains valid sense data. RETURN VALUES
The scsi_sense_info_uint64() function returns TRUE if the information field is present and valid. Otherwise it returns FALSE. The scsi_sense_cmdspecific_uint64() function returns TRUE if the command specific information field is present and valid. Otherwise it returns FALSE. CONTEXT
The scsi_ext_sense_fields(), scsi_sense_info_uint64() and scsi_sense_cmdspecific_uint64()() functions can be called from user or interrupt context. SEE ALSO
scsi_find_sense_descr(9F), scsi_sense_asc(9F), scsi_sense_ascq(9F), scsi_sense_key(9F), scsi_validate_sense(9F) SunOS 5.11 29 Jun 2006 scsi_ext_sense_fields(9F)
All times are GMT -4. The time now is 12:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy