answersLogoWhite

0

#include
#include

using std::cin;
using std::cout;
using std::endl;
using std::string;

int main(void)
{
string str1 = "nothing here";
cout << endl << "Enter a first string: ";
cin >> str1;

string str2 = "neither here";
cout << endl << "Enter a second string: ";
cin >> str2;

string srt = "result here";
cout << endl << "First string is: " << str1
<< endl << "Second string is: " << str2
<< endl << "Concatenation of two strings is: " << srt1 + str2
<< endl;

system("PAUSE");
return 0;

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

What is flowchart of stack using array in c prog?

Two little problems: 1. stack doesn't have a flow-chart 2. there are no flow-charts in a C program


When you delete an item from the empty stack will the program execute?

If the program correctly checks the error-conditions, it will terminate -- otherwise it will do... something, e.g. using memory-garbage as data.


Can you tell me a C program to find if the strings are equal using pointers?

It is called strcmp, part of the standard run-time library. Returns 0 if the two strings are equals, non-zero otherwise.


How do you increase the stack size of cc1plus dot exe for GCC 4 5 2 so it doesn't stack overflow?

If a stack is overflowing then there is usually some fundamental flaw in the program design. The best solution is to redesign the program. That said, one possible workaround might be to turn off optimisations with QMAKE_CXXFLAGS += -O0. However, it's far better to understand exactly why the stack is overflowing in the first place, and redesign the code to ensure it never happens. If you genuinely need a larger stack, then you can alter it programmatically using setrlimit.


Can the program counter be eliminated by using the top of the stack as a program count?

No. The program counter must be stored in a dedicated register. The stack is in working memory and you cannot operate on working memory; all values must be moved into a register in order to operate upon them. It makes no sense to move a program counter in and out of memory unless performing a context switch and you can't use a stack for context switching; a priority queue must be used for this. Keep in mind that the address of the top of the stack has to be moved in and out of its register during a context switch. It doesn't make sense to load the stack register from a priority queue before you can determine where the program counter value is. It's easier to keep all state information in the same place in the priority queue where it belongs.

Related Questions

C program to copy two strings in to a new string with out using stringcopy in borland c?

You can use so called concatenation of strings:{...string str1 = "something here";string str2 = " and something here";string newStr = str1 + str2;...}


Assembly language program for string concatenation using 8086 microprocessor?

write program to concatenating two sting in 8086 assembly language


How can you do the same thing as the program below but using strings and arrays in C language?

Program below?!


C program to implement tower of hanoi using array implementation of stack abstract datatype?

stack abstract datatype


Can you use stack in microprocessor for storage of data?

Yes, but not for long term storage, only while a program is executing using its stack.


Write a c program to copy two strings using pointers?

nahi malum


Write a program to convert stack into queue using c language?

In order to write a program to convert stack into queue using c language you must be able to identify the proper program. Having a special certification in programing will be beneficial as well to make sure you recognize the proper queues for the programs.


What is flowchart of stack using array in c prog?

Two little problems: 1. stack doesn't have a flow-chart 2. there are no flow-charts in a C program


What are advantages of stack?

some disadvantages created in stack using array then that problem solve to linked list use in stack.First advantage for size of stack not limited in linked list using.second essay to stack programme implement using only one pointer.


When you delete an item from the empty stack will the program execute?

If the program correctly checks the error-conditions, it will terminate -- otherwise it will do... something, e.g. using memory-garbage as data.


Can you tell me a C program to find if the strings are equal using pointers?

It is called strcmp, part of the standard run-time library. Returns 0 if the two strings are equals, non-zero otherwise.


How to perform string operations like concatenation compare etc without using built in functions?

performing string operation using pointers