Purchase Solution

functions in C and C++

Not what you're looking for?

Ask Custom Question

Problem:

Write a C function that includes the following sequences of statements:

x = 21;
int x;
x =42;

Run program and explain the results. Rewrite the same code in C++ and Java.

I understand Java:
Looks like this;
Java:
public int myMethod(int x)
{
x = 21;
x = 42;
return x;
}

It will return a value of 42 at the point of call, because the first value of 21 in x gets overwritten by the new value 42

Need help with C and C++ please.

Purchase this Solution

Solution Summary

Functions in C and C++ are examined.

Purchase this Solution


Free BrainMass Quizzes
C# variables and classes

This quiz contains questions about C# classes and variables.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Javscript Basics

Quiz on basics of javascript programming language.