Write a program to swap two names between two variables, Basic Computer Science

Assignment Help:

QUESTION

(a) Write a program to swap two names between two variables for examples:

N1 = "Mary Anne"

N2 = "Queen Mary".

The program should make use of an appropriate Function (for e.g. SwapFunc() ) and pointers to do this.

Your program should have three blocks namely the function declaration , the main and finally the function definition.

The Function SwapFunc() should be called from main.

The program should display the names in each variable before and after calling the function SwapFunc() in main.

(b) Write a piece of code (C or C++) to declare a pointer that is pointing to an array of characters named mychar for e.g.

                                mychar may contain the following five characters z, y, x, w, v

Your program should include codes to declare the array and the pointer to the array. It should also include codes to display the address of the first element in the array using pointers.

Using a loop for the pointers the subsequent codes should display the addresses of the four remaining characters.


Related Discussions:- Write a program to swap two names between two variables

What are the Proposals for Achieving Mutual Exclusion?, Proposal a) Disabli...

Proposal a) Disabling Interrupts (Hardware Solution) • Every process disables all interrupts just after entering in its critical section and re-enables all interrupts just previous

Entropy calculation, -(9/14)log2(9/14)-(5/9)log2(5/9) calculate with soluti...

-(9/14)log2(9/14)-(5/9)log2(5/9) calculate with solution.

Block matching algorithm, I am using block matching algorithm to get the mo...

I am using block matching algorithm to get the motion vectors, now, how can I get the depth map/depth value from the motion vectors?

Basic of simulation, Task 1 Study various types of systems and simulate a s...

Task 1 Study various types of systems and simulate a system of your own. Task 2 Study various models and enumerate the various steps for designing a corporate model

Grammar, Given the following grammar: -> [ , ] | -> | { } -> a...

Given the following grammar: -> [ , ] | -> | { } -> a | b | cwhich are the strings generated by the grammar? Show the parse tree(s). a). { [ a , b ] }b). [ { a } , b ]

Describe the common modeling techniques in uml, Question 1 Explain with an...

Question 1 Explain with an example the three kinds of relationships that are most important in object oriented modeling Question 2 Describe the Common Modeling techniques in

Static ram, STATIC RAM: Flip-Flops are the basic memory cells in a stat...

STATIC RAM: Flip-Flops are the basic memory cells in a static RAM. Each flip-flop is based on either two bipolar transistors or two Metal Oxide Semiconductors Field-Effect Tra

Instruction pipeline, How branching takes place in Instruction pipeline. Ex...

How branching takes place in Instruction pipeline. Explain with suitable examples.

Data structures hw help, Create an implementation of the Ordered Associativ...

Create an implementation of the Ordered Associative Array API using left-leaning red-black trees. Illustrate the use of the API by refactoring your WordBench as a client of Ordered

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd