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

Outdoor patient department features - a doctor module, A Doctor Module ...

A Doctor Module Doctor has a list of the patients waiting for consultation. The doctor's module should include all the following details: Fields for common complaint

Necessary nurses records, Necessary Nurses Records The software shoul...

Necessary Nurses Records The software should generate all registers/reports in detail summary for various permutations and combinations of options. A powerful SQL (Structure

Assembly Language Project, Our instructor gave us a project in making a mec...

Our instructor gave us a project in making a mechanical game or simple device using assembly language, can anyone give me a an example of a project description for our proposal?

Right click on a folder, I want the detailed theory about the options which...

I want the detailed theory about the options which occur when we right click on a folder.

Functions, difference between recursion and iteration

difference between recursion and iteration

Internetworking, You have been approached by Company XYZ to design and depl...

You have been approached by Company XYZ to design and deploy a new network that will span three cities in Queensland: Brisbane (12 users), Gold Coast (8 users), and Cairns (6 users

Explain the effects of a lack of communication, Question 1 Explain the dif...

Question 1 Explain the different categories of Software applications Question 2 Write a note on Data Dictionaries Question 3 Explain the following (a) Top-down testin

Configuration of a pc, Configuration of a PC: Generally, when you thin...

Configuration of a PC: Generally, when you think of purchasing a Computer, you first try to exactly know what will be the hardware components such as processor, memory etc. of

Nursing care activity module, Nursing Care Activity Module Retrievi...

Nursing Care Activity Module Retrieving of identification data of patient  Assessment of the patient  - Physical - Mental - Personal - Socio-c

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