C++ has no generic graphics capability whatsoever. Graphics are platform-specific, and every C++ implementation provides its own API and libraries specific to the intended platform.
For instance, the following user-defined Visual C++ MFC function will centre any text (t) within a given rectangle (r) relative to the given device context (dc):
void centre_text(CString& t, CRect& r, CDC& dc)
{
CRect b; // bounding rectangle.
// Calculate the bounding rectangle of the text:
dc.DrawText( t, b, DT_CALCRECT );
// Position the bounding rectangle in the centre of the given rectangle:
b.MoveToXY(
r.left + (( r.Width() - b.Width() ) / 2 ),
r.top + (( r.Height() - b.Height() ) / 2 ));
// Draw the text in the bounding rectangle:
dc.DrawText( t, b, DT_NOCLIP );
}
Note that the above code is non-generic and therefore cannot be ported to other platforms. It will only work in Visual C++ MFC applications. However, the principal will be largely the same on other platforms: calculate the bounding rectangle, move it to the centre of the intended rectangle and then print the text in the bounding rectangle.
Is Visual C plus plus easy to learn?
Visual C++ is as hard or as easy as any other IDE (Interactive Development Environment). It depends on how much time you put into it. Each IDE has its own nature, and we have a tendency to resist learning a new paradigm. If you were a master of one IDE, such as VC++, you might have difficulty in learning Eclipse, particularly at first glance, especially if you do not have a priority to do so. Again, it depends on time and effort.
What is double in 'c' language?
The double data type is a fundamental numeric data type that can represent floating point values. Depending on implementation, it is normally 8 bytes in size, with a precision around 18 decimal digits.
Where can you find a C plus plus program that accepts input and will uses while statement?
You can find C++ source code all over the Internet and in C++ reference books. The vast majority of programs accept input of some form or another, but not all programs use while loops (some don't use loops of any kind). The following example demonstrates input and while loops:
#include <iostream>
#include <string>
#include <sstream>
#include <time.h>
using namespace std;
void PrintOptions( string options )
{
cout << "Please enter one of ";
unsigned int i=0;
while( i < options.length() )
{
if( i )
{
if( i < options.length() - 1 )
cout << ", ";
else
cout << " or ";
}
cout << "'" << options.at( i++ ) << "'";
}
cout << "." << endl;
}
int PromptChar( string prompt, string options )
{
int result = -1;
while( result num )
{
cout << "Well done! You got it right in " << guess << " guesses.\n" << endl;
guess = 0;
}
else
{
++guess;
cout << "Too " << (i<num?"low":"high") << ". Try again." << endl;
}
}
}
return( 0 );
}
If a project is done in c plus plus then what is the frontend and backend?
The front-end is anything that interacts directly with the user (such as the GUI). The back-end is everything that goes on behind the scenes and is generally of no interest to the user. In a client-server application, the client is the front-end and the server is the back-end.
What types of A and B is the simple assignment statement A equals B legal in C plus plus?
A and B can be any type, even different types, so long as one can be statically cast to the same type as the other. Thus A can be the same class as B, or A can be a base class of B. But if B is not derived from A, then B must implement a static cast to type A. If such a cast would make no logical sense, then A=B makes no sense either, and would therefore be an illegal assignment.
Illegal assignments are not a bad thing as it actively prevents people from doing silly things. Twisting the logic in order to make an assignment legal won't necessarily make the assignment logical. You might not be able to stop them, but you can at least hinder them.
Imagine if A were Apples and B were Bananas. Does the assignment Apples=Bananas make any sense? On the surface, you would haver to say no. But if they were both derived from a common base class, say Fruit, then the assignment Apples=Bananas could theoretically be statically downcast to Apples::Fruit=Bananas::Fruit, in which case it has the potential to be a legal assignment. That is, only the Fruit portion of A would be assigned the Fruit portion of B. However, the logic behind Apples=Bananas is somewhat ambiguous. If the end-user really wanted to perform this type of assignment then the end-user should explicitly cast the types themselves, rather than hide the implementation behind an implicit Apples=Bananas assignment.
As a rule of thumb, overloading an assignment operator should always produce a predictable and logical result. If the logic of an assignment is unclear even to to you, then imagine how confusing it would be to the end-user, or to someone else simply reading your code (bafflement and bewilderment spring to mind). So if there's ever any ambiguity, it's best avoided. You can't stop people trying to do illogical things with assignments, but actively encouraging them by including illogical operators yourself says more about you than it does about them. If in doubt, leave it out. Don't make it too easy.
What do you mean by object as a software unit?
An object may represent a real-world object (in as much or as little detail as necessary), or it may be a completely imaginary object, such as conceptual object like a shape (rather than specific type of shape like a square). But regardless of what they represent, they are not physical objects that we can pick up and touch; they only exist in a computer's memory. Thus an object is a software unit.
Difference between links and association in object orinted analysis and design?
link is related to objects whereas association is related to classes
How do you access an object file?
These files are produced as the output of the compiler. They consist of function definitions in binary form, but they are not executable by themselves. Object files end in ".o" by convention, although on some operating systems (e.g. Windows, MS-DOS), they often end in ".obj".
What are the Different types of data type?
Java Data TypesJava is a powerful language that gives us options to have data in different forms. We have several data types that we can use for our needs. The basic data types that java offers us are termed as Primitive Data Types. Though all programming languages have varied data types java offers us with a variety of data types that are much powerful and simplified to use when compared to other languages.
The Java programming language is strongly-typed, which means that all variables must first be declared before they can be used. This involves stating the variable's type and name.
int age = 10;
The above statement tells the java compiler that a field named "age" which holds numeric data and having an initial value of 10 is declared. A variable's data type determines the values it may contain, plus the operations that may be performed on it. In addition to int, the Java programming language supports seven other primitive data types. A primitive type is predefined by the language and is named by a reserved keyword. Primitive values do not share state with other primitive values. The eight primitive data types supported by the Java programming language are: byte, short, int, float, double, long, char and boolean
Type conversion or type casting is the method of changing the entity of datatype to another.
When a class inherits from another class what is being extended?
When a derived class inherits from a base class, the base class functionality is being extended.
What motherboard form factor uses a riser card on the edge of the motherboard?
LPX or mini LPX uses a riser card ( also called a bus riser or daughter card).
LPX motherboard has the riser card near the center, whereas the NLX motherboard has the riser at the edge of the board.
What is automatic storage class specifiers?
Automatic storage is the default storage class for all non-static local variables including formal arguments. All automatic variables are allocated on the call stack and are automatically released when they fall from scope.
stdarg.h
What are public and private functions in C?
A private function can be either a nested function, but only if the compiler allows nested functions (ANSI C does not).
Or it can be a static global function. Static global functions are just like global functions, but they can only be used in the same module.
The naming convention requires that it's name begins with an underscore.
Global functions that are not static are public functions in C.
See:
[[http://groups.google.hu/group/comp.lang.c/browse_thread/thread/8e65b8824709a760/a396eb5a4472a6f8?lnk=gst&q=private+function#a396eb5a4472a6f8]]
What is the use of register keyword in C?
The register keyword tells the compiler to store the variable onto the CPU register if space on the register is available. The reasoning is that register operations are always faster than memory operations and thus if used correctly, it can speed up an algorithm. However, the register keyword is a somewhat antiquated procedure since for quite a long time the optimizer in modern compilers are smart enough to detect when storing a variable on the register will be advantageous and will do so during optimization. There for, suggesting to the compiler to store a variable on the register can only make things slower if used incorrectly.
The register keyword tells the compiler to store the variable onto the CPU register if space on the register is available. The reasoning is that register operations are always faster than memory operations and thus if used correctly, it can speed up an algorithm. However, the register keyword is a somewhat antiquated procedure since for quite a long time the optimizer in modern compilers are smart enough to detect when storing a variable on the register will be advantageous and will do so during optimization. There for, suggesting to the compiler to store a variable on the register can only make things slower if used incorrectly.
In many programs a statement called return -EINVAL is usedwhat does it mean?
EINVAL means error - invalid argument.
Who is Ms Nevada Plus the US 2007?
This years delegate for Ms. Nevada Plus America 2007 is Tracy Dawn. More can be found out about her at www.MsNevadaPlusAmerica2007.com
Should you file Form 2553 for an S Corporation that is currently dormant?
Form 2553 is an election to be treated as an S-Corporation. If your company is already an S-Corporation, you do not need to file it again (you only need to file it once). If you have not already filed Form 2553 for your corporation, and it is not currently conducting business, then there really isn't a need to file it until you are ready to start operations. Of course, keep in mind that Form 2553 must be filed no later than the 15th day of the 3rd month (March 15 for calendar year taxpayers) for it to be effective in the current year. So, if you plan to start business operations later this year it may be wise to go ahead and get it in place now. If the business was newly formed, it's tax year is considered a "short year" and you can file the 2553 on the 15th day of the 3rd month after forming the company. For example, if you formed a company on June 1, 2008 you wouldn't have to wait until 2009 to be treated as a S-Corporation because you missed the March 15 deadline. Your tax year is a short year, and runs this year from June 1, 2008 - December 31, 2008. So, you would have until September 15, 2008 to make the election.
Can a pointer to char data-type be type casted to pointer to integer type?
Yes it is possible in C language.
int main(void) { char *cptr; int *iptr; iptr=(int*)cptr; return 0; }
If you find the info useful Please Vote!!!