Program for swapping the two integers, C/C++ Programming

Program for Swapping the Two Integers

                For example, Swapping the two value

                                int x=4,y=6,t;

                                t=x;

                                x=y;

                                y=t;

                Similarly,

void Rolodex::insertAfterCurrent(const std::string& str)

{

       RolodexItem* t = current->next;     

       t->prev = current->next = new RolodexItem ();                               

       current->next->prev = current;                                                            

       current->next->next = t;                                                                

      current->next->value = str;                                                             

      current = current->next;                                                         

}

t = current->next 

set the next position of the pointer

 t->prev= new RolodexItem ();

Initiate the previous position into RolodexItem Object

current->next->next = t;

Set the next of current Next RolodexItem Object into t

Here, t (temporary) is used to change the position of the RolodexItem Object

Posted Date: 3/1/2013 7:27:02 AM | Location : United States







Related Discussions:- Program for swapping the two integers, Assignment Help, Ask Question on Program for swapping the two integers, Get Answer, Expert's Help, Program for swapping the two integers Discussions

Write discussion on Program for swapping the two integers
Your posts are moderated
Related Questions
search words from a passage and return snippets in html format..

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve betw

Pawnbroker software to be written in VB Project Description: I want software written for my pawnshop. I am currently using a program called pawnboss but would like to have my

I really have a hard time analyzing how to write a code in C. It''s all bout Time Departure and we must used a 24 hour clock. Can u help me?

how to see inbox details of a particular email adress on console

Program to sort a range of numbers with Insertion: /* define variable */ const int max=29000; int list[max]; FILE *fp; clock_t start,end; char any1[8];

A: In C++ there is a main difference among a template and a macro. Merely a macro is a string which the compiler replaces along with the value that was defined. For example #define

Objective: Construct a C program that controls the UART, and is capable of displaying strings. Echo characters received on the UART to the LCD screen Outcome: A mess

The break statement The break statement, which was already covered in the switch.. case, can also be used in the loops. When a loop statement is encountered in the loops the co