1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Julli [10]
3 years ago
14

When this program is compiled and executed on an x86-64 Linux system, it prints the string 0x48\n and terminates normally, even

though function p2 never initializes variable main. Can you explain this?
Computers and Technology
1 answer:
Alexxandr [17]3 years ago
5 0

Answer:

I get 0x55 and this the linking address of the main function.

use this function to see changes:

/* bar6.c */

#include <stdio.h>

char main1;

void p2()

{

printf("0x%X\n", main1);

}

Output is probably 0x0

you can use your original bar6.c with updaated foo.c

char main;

int main() // error because main is already declared

{

  p2();

   //printf("Main address is 0x%x\n",main);

  return 0;

}

Will give u an error

again

int main()

{

  char ch = main;

  p2(); //some value

  printf("Main address is 0x%x\n",main); //some 8 digit number not what printed in p2()

  printf("Char value is 0x%x\n",ch); //last two digit of previous line output

  return 0;

}

So the pain in P2() gets the linking address of the main function and it is different from address of the function main.

Now char main (uninitialized) in another compilation unit fools the compiler by memory-mapping a function pointer on a char directly, without any conversion: that's undefined behavior. Try char main=12; you'll get a multiply defined symbol main...

Explanation:

You might be interested in
How to transfer audio files from computer to android?
fenix001 [56]
U can use Bluetooth connect your computer to the android. <span />
5 0
4 years ago
To export data from a query to Excel, select the query in the Navigation Pane, click ____ on the ribbon, and then click the Exce
Gelneren [198K]

Answer:

External Data is the correct answer.

Explanation:

In the following statement, if the user wants to transfer data from query to Excel then, they follow these steps.

  • Firstly, they have to click on the Tools.
  • Then, they click on the options.
  • Then, they have to click on the Query then, click on the external data on the ribbon.
  • Finally, they click on the Excel button.
5 0
4 years ago
To use a resource from a module, you write the name of the module as a qualifier, using which symbol before the name of the reso
Sladkaya [172]

Answer:

d. .

Explanation:

Dot (.) symbol is used to access the resource from the module. It is used to establish the connection between resource and module.

While on the other hand "=" is an assignment operator that is used to assign a value to the variable. "*" is use for the purpose of multiplication of two values in variables. Double Inverted commas ("") used to print the statement written between them.

7 0
3 years ago
"What technology will examine the current state of a network device before allowing it can to connect to the network and force a
EleoNora [17]

Answer: A. Network Access Control (NAC)

Explanation:

The CORRECT answer is (A.) <em>Network Access Control (NAC)</em>. NAC refers to an method used in computer protection in which aspects such as antivirus, or host intrusion prevention among others are somehow consolidated in order to unify endpoint security. Such an approach allows the system authentication to enforce network security.

7 0
3 years ago
My iPod won’t turn on...and its 100% charged how do I fix it?
Nadusha1986 [10]
Try powering it off then holding in the home key for 30 seconds then try turning it on
6 0
4 years ago
Other questions:
  • It can be useful to have a mentor because they will help you
    7·2 answers
  • Based upon what you know
    5·1 answer
  • A software program installed without the user's knowledge and designed to alter the way a computer operates or to cause harm to
    12·1 answer
  • 5. What is the number one cause of accidents in the classroom, office, and home?
    8·1 answer
  • What differentiates Accenture's Intelligent Platform Services (IPS) when our clients are making a decision to partner with a ser
    13·1 answer
  • How can you make a search phrase more effective?
    8·1 answer
  • PLEASE HURRY!!<br> Look at the image below
    10·1 answer
  • One of the key properties of the ___________ approach is that a specific concept is represented by activity that is distributed
    5·1 answer
  • Dad Mystery
    9·2 answers
  • What do the blocks in the looks category do?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!