answersLogoWhite

0

📱

C++ Programming

Questions related to the C++ Computer Programming Language. This ranges all the way from K&R C to the most recent ANSI incarnations of C++, including advanced topics such as Object Oriented Design and Programming, Standard Template Library, and Exceptions. C++ has become one of the most popular languages today, and has been used to write all sort of things for nearly all of the modern operating systems and applications." It it a good compromise between speed, advanced power, and complexity.

2,546 Questions

Is it possible to access databases through C-CPP and if so how?

Most database vendors offer an API for this purpose. The usage will vary by vendor, but generally you open a connection, query (or runcommand), check or step through results, close connection. In the MS Windows environment, you can also use ODBC (Open Database Connectivity), which is an API that abstracts (no, its not C++ classes) the database, its tables, and its query language. You still have to install a vendor specific ODBC driver, and a vendor specific database client, so you still need to consult the vendor documentation. The procedure is similar to the non ODBC solution - you open the connection, query it, step through the results cursor, and close the connection.

What are the differences of turbo c plus plus and mother program?

No idea what mother program is, but I assume you mean how does Turbo C++ compare to the ISO C++ standard. The last version of Turbo C++ came out in 2006 and was compliant with the standard at that time. However, Embarcadero (the current owners) no longer support Turbo C++, thus it no longer complies with the current ISO standard.

How can you create a virtual copy constructor?

You cannot. Constructors are specific to the class in which they are declared. They cannot be inherited and so they cannot be virtual.

What is the C plus plus expression and operator precedence?

Precedence is determined by operators only. Every operator has a precedence in the range 1 through 17, where 1 has the highest precedence. All precedences have left-to-right associativity except 3 and 15 which are right-to-left.

Precedence 1: scope-resolution operator

Precedence 2: postfix increment/decrement, function-style type cast, function call, array subscripting and selection by reference or pointer.

Precedence 3: prefix increment/decrement, unary plus/minus, logical and bitwise NOT, C-style cast, dereferencing, address-of, sizeof, new/new [] and delete/delete [].

Precedence 4: pointer to member.

Precedence 5: multiplication, division and modulo.

Precedence 6: addition and substraction.

Precedence 7: bitwise left/right shift.

Precedence 8: relational operators (<, <=, > and >=).

Precedence 9: equal/not equal operators (= and !=)

Precedence 10: bitwise AND

Precedence 11: bitwise XOR

Precedence 12: bitwise OR

Precedence 13: logical AND

Precedence 14: llogical OR

Precedence 15: ternary conditional, assignment and compound assignment.

Precedence 16: throw

Precedence 17: comma

What is an aporphine?

An aporphine is a member of a class of quinoline alkaloids from which apomorphine can be derived.

What is ellipsis operator in c?

It somehow tells the compiler that the function will accept an unknown number of parameters.

Keywords in cpp?

auto break case char const continue default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef union unsigned void volatile while and and_eq asm bitand bitor bool catch class compl const_cast delete dynamic_cast explicit export false friend inline mutable namespace new not not_eq operator or or_eq private protected public reinterpret_cast static_cast template this throw true try typeid typename using virtual wchar_t xor xor_eq

Programme to implement single and multilevel inheritance taking employee as sample base class in c plus plus?

struct employee

{

};

struct supervisor : employee

{

// single inheritance -- a supervisor inherits all the public and protected properties of an employee.

};

struct manager : supervisor

{

// multilevel inheritance -- a manager inherits all the public and protected properties of a supervisor (and therefore an employee).

};

What is string class constructors?

Hello friends...

The String class supports several constructors. To create an empty String, you call the default constructor.

For example,

String s = new String();

Thank you

If you want CA CPT coaching in Tamil nadu kindly visit our website ksacademy

What symbol is use to join strings?

Language dependent. In C, for example, there no string as such, but you can use function strcat to concatenate zero-terminated character-sequences.

Is the ccc plus language for programming?

CCC+ is a sovereign credit rating. It is not a programming language.

How can you differentiate overloading of pre-fix and post-fix increment operator?

The prefix increment operator is overloaded as operator++() while the postfix increment operator is overloaded as operator++(int).

How are devices treated in C plus plus?

On some platforms (unix, for example) devices are handled as special files.

Is C plus plus Becoming Use Less Nowadays?

My opinion is no. I'm a plus two student and I'm studying in IHRD. Now I'm studing c++ programming. Most of the technical school follows the same way.

What is program verification in c plus plus?

Program verification typically uses static analysis software to analyse program source code. Much of this is done by the compiler itself, however the compiler's primary job is to ensure the code will compile, not that it is logically correct, or efficient, or that it will actually solve the problem.

For instance, the following is perfectly acceptable as far as the compiler is concerned:

if (true) {

}

else if (true) {

// unreachable

}

else {

}

However, program verification will fail because the else if (true) clause is unreachable.

Similarly, it can happen that the then clause is exactly the same as the else clause:

int x;

if (true)

{

x = 42;

}

else

{

x = 42;

}

Problems such as these can be extremely subtle. The compiler will issue no warnings and the program will appear to work exactly as intended, but they are problems nonetheless. In these cases, program efficiency will be affected. They both produce programs that will be slightly larger than they need to be, but the second introduces an unnecessary decision along with duplicate code, thus affecting performance.

Throwing exceptions from a destructor is another problem.

struct foo

{

int m_data;

~foo() { if (!m_data) throw; }

};

In fact, it is illegal. Destructors must never throw exceptions. Yet the compiler allows it. If an exception could occur during destruction then it must be placed within a try...catch block and handled accordingly. Nothing should ever prevent an object from destroying itself.

PVS-Studio (see sources and related links below) is a good example of program verification software and is used primarily to validate open-source software. The website lists a number of problems that have been detected by the software, along with some examples of these problems.

How can you easily understand c plus plus of XII class?

Yes, I do. But most of my friends didn't. It depends on an individual, on your interest. I studied Class XII C++ CBSE and beyond in my summer vacations of Class XI. I just like programming so i understood it, but i failed in chemistry thrice in 2 years. My minimum was 07/70 in chem.

Dont worry if you find it hard. Just install Turbo C++ in your system and start with real easy programs. Program more than 50 on your systm and it will become really really easy for you and in a month you will start liking it.

Remember, things wont work if you dont try.

What is the largest value that can be stored in 64 bits represented in hexadecimal?

0xffffffffffffffff

As an unsigned 64-bit integer, this represents the value 18,446,744,073,709,551,615.

However, as a signed 64-bit integer, this only represents the value -1. The signed range is -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 making 0x7fffffffffffffff the largest possible positive value, and 0x8000000000000000 the smallest possible negative value.

What are read only objects in c plus plus?

Read-only objects are those that have private immutable member variables with public accessors (getters) but no public mutators (setters). The object members are typically initialised during construction, but the member variables cannot be altered thereafter, thus they are read-only.

Why do you need to private part of a class and how to access them?

You don't need to make any part of a class private, but then it would behave no differently to a struct, which is public by default. The point of private access is to hide data and methods that are internal to the class; you are not supposed to be able to access them from outside the class.

There are three levels of access: private access is only accessible to the class itself, and to friends of the class. Protected access is the same as private, but is also accessible to derived classes. Public access is accessible to all.

To give an example, imagine the following structure:

struct s

{

unsigned int num;

};

Suppose the num member can be any positive value but must never be zero. That means that whenever we pass this structure to a function, we must assert or verify that num is non-zero. We are relying on those functions to perform verification that should rightly be performed by the structure. But num is public, so there's really no way to safeguard against the structure containing invalid data.

So let's replace the structure with a class:

class c

{

public:

c():num(1);

void setnum(unsigned int number){if(number !=0 ) num = number;}

unsigned int getnum()const{return( num );}

private:

unsigned int num;

};

Now we can be sure that num is never zero. The constructor automatically sets num to positive 1, and the setnum mutator only changes num if the given number parameter is non-zero. Meanwhile, the getnum accessor returns a copy of num, not a reference to num. Only the class itself has access to the private num variable, thus the data is hidden from outside influence, and the public interface guarantees that num will always be non-zero. We no longer need to verify this fact because that functionality is encapsulated within the class itself, where it belongs.

Can abstraction encapsulation be achieved in C program if yes explain?

abstraction and encapsulation is one of the concepts of OOPs and C is not an OOP [Object Oriented Programming language] obviously abst & encap will not be supported by 'C' Abstraction & encapsulation is a concept of OOP [Object Oriented Programming] But, 'C' is not an OOP whereas it is a POP [Procedure oriented programming], so obviously 'C' does not support abstraction and encapsulation

Answer Encapsulation is not inherently supported but it can be emulated in C. The use of static and extern keywords for functions are almost equivalent to your private and public keywords in java (encapsulation). Read up more on those keywords.. Structures become an object's attributes while functions accepting pointers the the said struct become its methods.

Trending Questions
How do you use C plus plus code in Java Program? Write C coding for swamping the values of two variables without using a third variable? Should you explicitly call a destructor in C programming? How do you open a project in Microsoft visual studio 2008? Is Java the best programming language to develop an operating system - I want to know if Java is capable of producing a good operating system except other languages like C plus plus Python Ruby VB etc? How to write an algorithm that reads a number N calculates and displays the reverse of N e.g 3465789 becomes 9875643? What is the salary of a java programmer and a c plus plus c programmer? What type of logical access control method allows you to define who can access an object and type of access that they will have to that object? How do you save GIF extension file in Dev c plus plus? How do you write c plus plus program to display size of the each data type? Both Java and C plus plus compile source code to object code yet Java is called an interpreted language while C plus plus is called a compiled language explain this notion? How do you implement queue using stack in c plus plus? What is compile time? Write a assembly languagprogram that generates and displays 50 random integers between -20 and plus 20? How do you call base class method using derived class object? Write a program to perform a binary search on an unsorted list of n integers? How ploymorphism and inheritance is different from that in Java and c plus plus? You have turbo c plus plus 4.5 versioni want to run graphics program in 'c'.But there will be an error bgi file not supported under window what would you do? How do you read figures from a text file and write them in tabular form in an excel spreadsheet in c plus plus? What is static in c plus plus programming?