The simple answer is yes, it works in both.
What is data dictionary of c plus plus?
A data dictionary is structured data about data (metadata), typically employed by a DBMS, either passively (requiring manual, independant updating), or actively (automatically updated alongside and prior to DBMS updates). Data dictionarie's don't really apply to the C++ language as such, but you can model a data dictionary using C++ wherever you need structured data about data within your database programs.
What is the meaning of near and far declaration in microprocessor programming using C?
Programs that are loaded into memory typically have several segments associated with them: the Code Segment (CS), the Stack Segment (SS), the Data Segment (DS), sometimes an Extended Segment (ES), and almost always a Block Started by Symbol (BSS) segment. This question requires that we focus only on the Code Segment (CS). The CS is a segment of memory that contains some of the instructions that are required for the program to execute. If this segment is not large enough to contain the whole program then the program can be loaded into different segments. Such a segment may be 64Kb in size (although the size may differ). Instructions located in these segments are referred to by their offset from the start of the segment, and not by their absolute location in memory. Thus, in order to locate a certain instruction, we need the segment's starting address, and the offset of the instruction in that segment. Whenever a branch (jump, goto) takes place which refers to an instruction that is located in another segment, it is known as a far jump, conversely whenever a jump refers to an instruction that is located in the same segment, it is known as a near jump. The difference referring to the modication of the CS register which contains the address of the current Code Segment for the current running program.
Write a C program to accept roll numbers and names of 10 student using array and display the names?
Well, we're not going to do it for you.
There's some example code and tutorials at http://www.cplusplus.com/doc/tutorial/ . It's for C++, but the code is simple enough that it shouldn't make a difference. Adapt that, and it should do exactly what you want.
Is it possible to declare a keyword as an identifier in c plus plus?
No. Keywords are reserved and cannot be used as identifiers. However, C/C++ is case-sensitive. So although register is a reserved keyword, Register is not.
What is the origin of c plus plus language?
The origin of C++ is 'C with Classes', which was developed by Bjarne Stroustrup between 1978 and 1983, at which point the name changed to C++. Bjarne originally developed 'C with Classes' as an extension to C, chiefly adding object-oriented programming to the language along with other extensions. He chose C as the basis for the language because it was one of the most popular languages at the time, and was fast, portable and general purpose. However the OOP extensions were inspired primarily by Simula, as well as other languages including ALGOL 68, Ada, CLU and ML.
How do you add printer in turbo C plus plus?
Adding printers is a function of the operating system. The operating system should also provide facilities that allow you to enumerate all printers registered with the operating system.
How do you output multiple 's on a single line in c plus plus programming language?
its supposed to have an asterisk there before the 's but it wouldnt print it
Array implementation of priority queue?
the priority queue is which depends on the data stored.in which their priority is maintained by checking the forth coming values stored in the queue
What is use of toolbar in vc plus plus?
Toolbars are a graphical user component intended to augment an application's command menu (menu bar). Although the command menu contains all the commands available within the current context, it can be a chore drilling through sub-menus to get to the command you want -- assuming you know where the command exists within the menu hierarchy. Modern command menus will only show the most-used commands, using a special drop down to reveal lesser-used commands. And while accelerators (key-combos) do help speed things up it can still take time to become familiar with uncommon or little-used keystrokes.
Toolbars make it possible to display your most-used command icons in palettes, some of which may be customisable. Toolbars are typically dockable panes that can be detached or docked wherever you please. Even the Windows shell has toolbars which can be docked to the taskbar. These toolbars cannot be detached however, but the principal is largely the same: to provide quick access to the commands you use most often.
Why is it important to use virtual private network to send sensitive data?
Because now a days it is cheep and from vpn you can send the data securely. Because VPN split the datas into smaller cells as well send it through different routes. Because now a days it is cheep and from vpn you can send the data securely. Because VPN split the datas into smaller cells as well send it through different routes.
When and why is it required to inherit virtual base class?
Whenever two or more classes are derived from the same base class, and another class is derived from both derivatives via multiple inheritance, and the common base class can be shared amongst all derivatives.
For instance, if a base class, V, is a common base class of two derived classes, A and B, and class D is derived from both A and B, then class D will inherit two separate instances of class V (one from A, the other from B). By declaring V to be virtual in both A and B, class D will only inherit one instance of V, which is then shared between A and B. Any changes made to the member variables of the shared V will be automatically reflected in A, B and D.
Bear in mind that not all base classes can be declared virtual. If V contains any member variable that must be unique to A and B, then A and B cannot share the same instance of V.
It would therefore follow that D probably cannot share V with either A or B. If D requires its own instance of V, the only solution is for D to inherit from A, B and V, thus A, B and D will each have their own separate instances of V.
However, if D can share an instance of V from either A or B, then there is no need for D to inherit its own copy of V. In this case, you can use the scope resolution operator to refer to a specific instance of V, whether it belongs to A or B. In other words, A::V or B::V.
Ultimately, the decision to make V virtual in direct derivatives will depend on whether a single instance of V can be shared between those derivatives and that is entirely dependant upon the actual purpose of V. To be a virtual base class, V should ideally be an abstract data type with no unique member variables whatsoever. And provided classes A, B and D override all the pure-virtual methods inherited from V, there will be no ambiguity whatsoever. Invoking a pure-virtual method on V will call the most-derived method in D, which can, optionally, call the overridden methods in either A or B, or both, via their scope resolution operators.
prototyping is an approach to e development to a system where software simulates the aspects of an actual processing system, in simple words prototyping can be called as a shorter version of working system,
thanks
Bharat Kumar Mishra
bharat9234@yahoo.com
Write a c sharp program to print 1 22 333 4444 55555 as right angle trianglr?
using System;
namespace RightAngleTraingle
{
class Program
{
static void Main(string[] args)
{
for (int x = 1; x <= 5; x++)
{
for (int y = 1; y <= x; y++)
{
Console.Write(x.ToString());
}
Console.WriteLine();
}
Console.Read();
}
}
}
Thanks & Regards,
Shoaib R Khan - SRK
What is difference between single and double selection structures?
In programming
What is an easy way to learn C plus plus?
Simplest but possibly the hardest way to learn: 1. Buy a book that can teach you how to use C programming language 2. Get a program to process C programming language in, so as to have practical experience.
Major advantage in cpp compared to c?
The major advantage of C++ over C is the Object Oriented Programming compatibility in C++.
What is balanced binary search tree in c plus plus?
#include<iostream>
template<typename T>
class bin_tree
{
class node
{
T data;
node* left {nullptr};
node* right {nullptr};
public:
node (const T&);
node (const node&);
node (node&&);
node& operator= (const node&);
node& operator= (node&&);
~node ();
void insert (const T&);
bool exists (const T&) const;
std::ostream& depth_first_print (std::ostream&) const;
};
node* root {nullptr};
public:
bin_tree ();
bin_tree (const T[], const size_t);
bin_tree (const bin_tree&);
bin_tree (bin_tree&&);
bin_tree& operator= (const bin_tree&);
bin_tree& operator= (bin_tree&&);
~bin_tree ();
void clear ();
void insert (const T&);
bool exists (const T&) const;
std::ostream& depth_first_print (std::ostream&) const;
};
// node output stream insertion operator (depth-first traversal)
template<typename T>
std::ostream& operator<< (std::ostream& os, typename const bin_tree<T>& t)
{
return t.depth_first_print (os);
}
// node default/conversion constructor (construct a node from a type T)
template<typename T>
bin_tree<T>::node::node (const T& value)
: data {value}
{}
// node copy constructor
template<typename T>
bin_tree<T>::node::node (typename const bin_tree<T>::node& rhs)
: data {rhs.data}
, left {rhs.left ? new node {*rhs.left} : nullptr}
, right {rhs.right ? new node {*rhs.right} : nullptr}
{}
// node move constructor
template<typename T>
bin_tree<T>::node::node (typename bin_tree<T>::node&& rhs)
: data {std::move(rhs.data)}
, left {std::move(rhs.left)}
, right {std::move(rhs.right)}
{
rhs.left = nullptr;
rhs.right = nullptr;
}
// node copy assignement operator overload
template<typename T>
typename bin_tree<T>::node& bin_tree<T>::node::operator= (typename const bin_tree<T>::node& rhs)
{
delete left;
delete right;
data = rhs.data;
left = rhs.left ? new node (*rhs.left) : nullptr;
right = rhs.right ? new node (*rhs.right) : nullptr;
}
// node move assignment operator overload
template<typename T>
typename bin_tree<T>::node& bin_tree<T>::node::operator= (typename bin_tree<T>::node&& rhs)
{
delete left;
delete right;
data = std::move (rhs.data);
left = rhs.left;
right = rhs.right;
rhs.left = nullptr;
rhs.right = nullptr;
}
// node destructor
template<typename T>
bin_tree<T>::node::~node ()
{
delete left;
delete right;
}
// node print method (depth first traversal)
template<typename T>
std::ostream& bin_tree<T>::node::depth_first_print(std::ostream& os) const
{
if (left) left->depth_first_print (os);
os << data << ' ';
if (right) right->depth_first_print (os);
return os;
}
// node exists method
template<typename T>
bool bin_tree<T>::node::exists (const T& value) const
{
return value == data ? true :
value < data && left ? left->exists (value) :
value > data && right ? right->exists (value) :
false;
}
// node insertion method
template<typename T>
void bin_tree<T>::node::insert (const T& value)
{
if (value < data)
{
if (left)
left->insert (value);
else
left = new node {value};
}
else
{
if (right)
right->insert (value);
else
right = new node {value};
}
}
// tree default constructor (construct an empty tree)
template<typename T>
bin_tree<T>::bin_tree ()
{}
// tree overloaded constructor (construct a tree from an array)
template<typename T>
bin_tree<T>::bin_tree (const T arr[], const size_t size)
{
for (size_t index=0; index<size; ++index)
insert (arr[index]);
}
// tree copy constructor
template<typename T>
bin_tree<T>::bin_tree (const bin_tree<T>& rhs)
{
*this = rhs;
}
// tree move constructor
template<typename T>
bin_tree<T>::bin_tree (bin_tree&& rhs): root{rhs.root}
{
rhs.root=nullptr;
}
// tree copy assignment operator overload
template<typename T>
bin_tree<T>& bin_tree<T>::operator= (const bin_tree<T>& rhs)
{
if (root)
delete root;
if (rhs.root)
{
root = new node {*rhs.root};
}
return *this;
}
// tree move assignment operator overload
template<typename T>
bin_tree<T>& bin_tree<T>::operator= (bin_tree&& rhs)
{
if (root)
delete root;
root=rhs.root;
rhs.root=nullptr;
return *this;
}
// tree destructor
template<typename T>
bin_tree<T>::~bin_tree ()
{
clear();
}
// tree print method (depth first traversal)
template<typename T>
std::ostream& bin_tree<T>::depth_first_print(std::ostream& os) const
{
return root ? root->depth_first_print (os) : os << "{empty}";
}
// tree clear method
template<typename T>
void bin_tree<T>::clear ()
{
delete root;
root = nullptr;
}
// tree insertion method
template<typename T>
void bin_tree<T>::insert (const T& value)
{
if (!root)
root = new node {value};
else
root->insert (value);
}
// tree exists method
template<typename T>
bool bin_tree<T>::exists (const T& value) const
{
return root ? root->exists (value) : false;
}
int main()
{
int arr[10] = {42, 56, 30, 5, 12, 60, 40, 8, 1, 99};
std::cout << "Test default constructor:\n";
bin_tree<int> a {}; // {} is implied if omitted
std::cout << "a: " << a << std::endl;
std::cout << "\nTest overloaded constructor:\n";
bin_tree<int> b {arr, 10};
std::cout << "b: " << b << std::endl;
std::cout << "\nTest tree copy constructor (c{b}):\n";
bin_tree<int> c {b};
std::cout << "b: " << b << std::endl;
std::cout << "c: " << c << std::endl;
std::cout << "\nTest tree move constructor (d{move(b)}):\n";
bin_tree<int> d {std::move(b)};
std::cout << "b: " << b << std::endl;
std::cout << "c: " << c << std::endl;
std::cout << "d: " << d << std::endl;
std::cout << "\nTest insertion into c:\n";
c.insert (41);
std::cout << "b: " << b << std::endl;
std::cout << "c: " << c << std::endl;
std::cout << "d: " << d << std::endl;
std::cout << "\nTest search:\n";
if (c.exists (41))
std::cout << "Value 41 exists in c" << std::endl;
else
std::cout << "Value 41 does not exist in c" << std::endl;
if (d.exists (41))
std::cout << "Value 41 exists in d" << std::endl;
else
std::cout << "Value 41 does not exist in d" << std::endl;
std::cout << "\nTest copy assignment (c=d):\n";
c = d;
std::cout << "b: " << b << std::endl;
std::cout << "c: " << c << std::endl;
std::cout << "d: " << d << std::endl;
std::cout << "\nTest move assignment (d=move(c)):\n";
d = std::move (c);
std::cout << "b: " << b << std::endl;
std::cout << "c: " << c << std::endl;
std::cout << "d: " << d << std::endl;
std::cout << "\nTest clear method (d.clear()):\n";
d.clear();
std::cout << "b: " << b << std::endl;
std::cout << "c: " << c << std::endl;
std::cout << "d: " << d << std::endl;
}
Which line has all reserved words in C plus plus?
No line can ever contain every reserved word. For one thing, preprocessor directives and labels must appear on separate lines. Excluding these, any code segment can be written as a single line, which could feasibly include all keywords. However if you classify a line as being a code segment ending with a semi-colon, there can be no single line with all keywords because continue and break are mutually exclusive.
In C++ there is no such thing as a parameter, there are only arguments, both actual and formal. Some languages use the term parameter to mean a formal argument and argument to mean an actual argument, while others reverse the meanings completely. Some languages make no distinction at all and use the terms parameter and argument interchangeably. However, C++ is quite clear on this: actual arguments are the names that you pass to a function, while formal arguments are the names received by the function. Even so, you will still encounter incorrect usage of the terms parameter and arguments, even by C++ experts (myself included!)
The following example code demonstrates the difference between an actual argument and a formal argument, as the terms apply in C++:
int foo(int formal)
{
return(formal*2);
}
void bar(int& formal)
{
formal*=2;
}
int main()
{
int actual=1;
actual = foo(actual);
bar(actual);
return(0);
}
The function foo() declares a formal argument by value while bar() declares a formal argument by reference. In main() we declare a variable with the name actual and pass this actual argument to both functions in turn.
When we pass actual to foo(), the value of actual is assigned to formal. Since formal is a copy of actual, they are separate names with separate values (initially they will have the same value of course). Thus any changes made to formal will have no effect on actual, hence we must assign the return value from foo() to actual in main(), in order to record the change made by foo().
When we pass actual to bar(), a reference to actual is assigned to formal. A reference is simply an alternate name for the same argument, however the name actual is not visible to bar(), so they are still separate names, but they always have the same value. Thus any changes to formal will affect actual, thus there is no need to assign any return value to record the change.
Why can't have only float data type instead int and float?
Because that is how the language is defined. It has floating data types and integral data types.
How do printf's format specifiers e and f differ in their treatment of floating-point numbers?
%e expects a corresponding argument of type double; %f expects a corresponding argument of type float.
What is an address in C plus plus programming?
An address in C or C++ is the location in memory of an object or function. An address is the contents of a pointer, as opposed to the contents of the memory location pointed to by the pointer.