Consider the following program, which consists of two object modules:
When this program is compiled and executed on an x86-64 Linux system, it prints the string 0×48\n and terminates normally, even though function p2 never initializes variable main. Can you explain this?
Want to see the full answer?
Check out a sample textbook solutionChapter 7 Solutions
Computer Systems: A Programmer's Perspective Plus Mastering Engineering With Pearson Etext -- Access Card Package (3rd Edition)
Additional Engineering Textbook Solutions
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Using MIS (10th Edition)
Differential Equations: Computing and Modeling (5th Edition), Edwards, Penney & Calvis
Database Concepts (8th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
C How to Program (8th Edition)
- What is the distinction between the static and extern storage classes? Give appropriate examples to back up your response.arrow_forwardYou are given a class with synchronized method A and a normalmethod B. If you have two threads in one instance of a program, can they both execute A at thesame time? Can they execute A and B at the same time?arrow_forwardWrite a carpet bombing program in code blue that zeros out all of memory( with the possible exception of the program location)arrow_forward
- What is the distinction between the static and extern storage classes? Give appropriate instances in in support of your responsearrow_forwardWhen I attempt to run this program, I am getting an ArrayIndexOutOfBounds Exception on line 21 of the given Main. What is causing this to occur and what can be done to fix it? import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.LinkedList;public class Main{public static void main(String[] args) throws IOException {// Create a new LinkedList object for holding the ValueData object:LinkedList<ValueData> linkedList = new LinkedList<>();// Create a new ObjectStack objectObjectStack objectStack = new ObjectStack();// Read a text file containing lines (records) of ValueData.// This is in order to fill the LinkedList with ValueData from the file.BufferedReader reader = new BufferedReader(new FileReader("values.txt"));String line = reader.readLine();while (line != null) {String[] parts = line.split(",");String name = parts[0].trim();int value = Integer.parseInt(parts[1].trim());ValueData data = new ValueData(name,…arrow_forwardWrite a program that replaces all occurrences of a word with anew word in all the files under a directory, recursively. Pass the parameters fromthe command line as follows:java Exercise18_31 dirName oldWord newWordarrow_forward
- You have written a C program which was stored in file someProgram.c, under directory /home/chloe/TestingCode; in that same directory, you have a sub-folder called Old. Answer the following questions (by typing the appropriate single command line instruction in each case), assuming you are currently in /home/chloe/TestingCode: Compile the code in someProgram.c. Create a new sub-folder called New under /home/chloe. Show the location (i.e., the full path) of the current directory. Make a copy of the file someProgram.c and call it someProgram_v2.c.arrow_forwardHey there I am struggling with creating a second class module in PYTHON - that would import an already existing class I have finished from another module file called LANDINGSPOT, the class I am struggling with follows the exact order below* - class PLANE first-class which is done (Landingspot CLASS with objects ID, city, country ) and am trying to create another class module PLANE. (flightNumber, Start, goingTo). Each class would be eventually reading from text files with some spaces and commas separating randomly that’s where they would be getting data but that's for another module, which would need to import PLANE class. 'As suggested by its name, this class represents a 'Plane' from one landingSpot to another landingSpot in the program. Each Plane object must have a flightNumber (the unique 6-character code containing 3 letters followed by 3 digits), Start place, and a goingTo. Both the Start and goingTo must be LandingSpot objects within the…arrow_forwardIs overloading correct?arrow_forward
- Implement a simple version of the linux cat command in C++. Use the system calls open(), get() and close(). cat - reads a file as specified by the user and prints its contents. A typical usage is as follows: If from my terminal y run ./cat main.cpp the contents of main.cpp. will be printed. Your program cat can be invoked with one or more files on the command line; it should just print out each file in turn. Example: [terminal]$ ./cat main.cpp main2.cpp #include <iostream>using namespace std;int main(){cout << "Hello, World!"; return 0;}#include <iostream>using namespace std;int main(){cout << "Programming is great fun!";return 0;} As you can see content of main.cpp was printed first and the content of main2.cpparrow_forwardWrite in C for STM32F446RE microcontroller on the Nucleo-64 dev board uncluding proper header files Write a source library that contains the with the following public functions: void keypadInit(void); /Initiallized the GPIO to read the keypad. uint16_t readKeypad(void); //Returns the state of all of the keypad buttons in the return value at the moment the function is called. void decodeKeypad(uint16_t, char *); //Takes the state of the keypad and returns (by reference) an array of the key's pressed. The library should work with the following main: int main (void) { uint16_t key; char carray[17]; keypadInit(); while(1) { while(!(key = readKeypad())); /*Get which keys pressed*/ decodeKeypad(key, carray); /*What are those keys*/ printf("%s\n",carray); /*Print those keys to screen*/ while(readKeypad() == key); /*Wait for the keypad to change*/ }} Problem 1: Write a library that works with the following…arrow_forwardThis is a MASM Project Assembly Code for x86 Processors ! The code below is supposed to copy whatever's in the source variable into the target variable. However, there is a single error, which will cause it to work correctly if fixed. What is it? .datasource WORD 10 DUP("AO")target WORD 10 DUP(?).codemov esi, OFFSET sourceadd esi, 18mov edi, OFFSET targetadd edi, 18mov ecx, LENGTHOF targetstdrepe movsw Group of answer choices: A: 18 should not be added to the ESI and EDI registers B: ECX should be set to the length of the source, not the target C: The direction flag should be cleared with CLD, not set with STD D: The REPE prefix should be replaced with REParrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education