answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Why write programs in machine code?

The resulting programs are more efficient, use less processor cycles and memory. Because michine code is the most basic form of language that a processor can understand. It consists of 1's and 0's. It needs no interpreter to interpret to the processor and therefore is the fastest way to tell a processor which commands to run.

What is x85 assembler?

laura ka site hai jo ek answer nahi hai

1 nano second is 1 billion of a second is true?

1 nano second is actually the 1,000,000,000th of a second, or 10-9 s. It is a billion-the part of a second in the short scale, where a billion is one thousand million, or 109, but it not in the long scale, where a billion is regarded as one million million, or 1012.

Billion, Trillion (and names for even larger numbers) are not universally unique.

The correct answer to this question therefore is "yes, provided that you assume a short scale billion as common in most English and Arabic speaking countries.

See related links for more.

What is the need of constructor overloading?

To have options wherein we can create objects of a class with different sets of parameter (initial) values

What is the name of the path and file name for the file that contains all user information?

That depends on the operating system. In Windows, user information is contained in the registry file for each user. E.g., Users\<username>\NTUSER.DAT. In Linux there is no registry as such, but user credentials will be found under /etc or sometimes /usr/local/etc.

What is distinct nodes?

distinct_nodes is a feature of XQuery, returning all the distinct nodes that match the criteria.

What is the orthocenter of a triangle?

The orthocenter of a triangle is the point where the three altitudes of the triangle intersect. An altitude extends from a vertex (i.e. corner of the triangle) to the side opposite of it, and is perpendicular either to the side of the triangle, or to its extension. The three altitudes of a triangle are always concurrent (intersect at the same point). This point is known as the orthocenter, and always falls on the Euler Line with the centroid, circumcenter, and the center of the triangle's nine-point circle.

What is Realloc?

This involves allocating and de-allocating memory at run-time. Look into the new and delete operators for C++ or malloc and free for C.

What are unconditional statements?

An unconditional statement is one which would happen always (unconditionally).

Conditional statement:

if(x > 5)

print "Hello!"

Unconditional statement:

print "Hello!"

This term also comes up when speaking of assembly instructions. An unconditional jump would be a line of assembly which always executes the jump. This is in contrast to a conditional jump (also known as a branch) which will execute the jump only if some statement evaluates to true.

Maximum memory a 32bit can address?

32-bit system can address:

2 to the power of 32 = 4.3 Giga different addresses, corresponding to 4.3 GB of RAM

as it needs to manage other stuff than the RAM (motherboard, expansion cards, including the graphics card), it remains only about 2.8 to 3.3 GB of RAM addressable following configuration PC.

What do you do when a box comes up that says object reference not set to an instance of object?

in vb.net dim xyz as myclass=new class or dim xyz as new myclass you might have missed the new key word

AnswerThink of all data as an "object". An object can be something simple, like an integer, or can be something cmoplex (what we call an "aggregate"... a mixture of things, like the way comcrete is an aggregegate mixture of stuff)... such as a "Customer", with a name, ID Number, and account balance. An object is stored in memory, and is referred to or "Referenced" by a variable. Dependign on the language you are writing in, this relationship between the variable and the object (what we call an "instance" of an object.) may be very clear, or it may be somewhat ambiguous. Think of a an object variable like an index card that holds an address. If I hand you a blank index card, you indeed have something on which you can record an address, but you have no address-- The index card is an object reference, but at this moment it doesn't refer to anything.

Some variables, like an integer for example (simple built-in types in most languages) are usually automatically initialized to point to an instance of an object of the appropriate type. Some languages will then even initialize that object with a default value (like 0 for an integer in Basic). However, complex object types (the classes you define) are not automatically initialized to instances of an object. In Visual Basic, you insantiate an objec tiwht the SET keyword and use NEW to create a new instance:

Dim x as MyClass set x = new MyClass

In C#, You simply assign the object variable an instance of the class:

MyClass x; x = new MyClass();

You are receiving the "Object Reference Not Set to an Instance of an Object" because at some point in your program, you are trying to use or manipulate the data stored in an object variable, but the object isn't pointing to anything. This would be like getting in your car with the blank index card I gave you and trying to drive to an address that doesn't exist. :)

Jim

What is difference between 'call by value' and 'call by reference' in the book-computer in programming language-author -vrajaramani?

With call by value semantics, the value of the variable is passed to the function.

With call by reference semantics, the memory address of the variable is passed to the function.

Pass by reference is typically used to pass large and complex types to functions because there is no performance penalty in passing objects by reference. Passing by reference also makes it possible for the function to modify the argument. If the function does not need to modify the reference, the reference should be declared constant. This assures the caller that the non-mutable members of the object being passed will remain in an unmodified state.

Pass by value should only be used to pass primitive or built-in data types. That is, any type that is small enough to fit into a CPU register. This is because pass by value makes a copy of the variable and copying large or complex variables can be an expensive operation in terms of both performance and memory consumption. Imagine passing an array with 1 million elements, each of which must be copy constructed! Copying a single memory address is as cheap as it gets and that's precisely what pass by reference means.

Some languages do not support a native reference type and therefore default to pass by value semantics. C is a typical example. However, C supports native pointer types which are simply variables that store memory addresses. Thus you can enable pass by reference semantics by passing a pointer by value. The pointer itself is copied, not the value being pointed at.

Many high-level languages do not support native pointers and therefore default to pass by reference semantics. However, this is achieved through resource handles; there is an underlying pointer being passed (by value) behind the scenes but it is (usually) inaccessible to the programmer. Java is a prime example of this. If you wish to use pass by value semantics you must explicitly pass a copy of the object. Defaulting to pass by reference semantics simply encourages efficient coding.

C++ is one of a few languages that supports both pointers and references and either method can be used to enable pass by reference semantics. The main differences between a pointer and a reference are that pointers are variables which may be null whereas references are aliases (alternate names for existing objects) which can never be null. More specifically, the address of a reference is the address of the object being referenced and that object must exist (a null reference is an error). A pointer refers to the address stored in the pointer itself (the value of the pointer) thus the address of a pointer is separate from the address of the object being pointed at. This makes it possible for pointers to refer to other pointers, thus making it possible to pass pointers by reference.

What is the difference between implicit and explicit call of constructor in c plus plus?

An implicit constructor call will always call the default constructor, whereas explicit constructor calls allow to chose the best constructor and passing of arguments into the constructor.