Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
- Given the following C code:
int a[10] = {0,1,2,3,4,5,6,7,8,9};
int *m = &a[0];
int *p = &a[5];
int *q = &a[1];
p = (int) m + (int) p - (int) q;
What is the value of *p?
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write in C++ Sam is making a list of his favorite Pokemon. However, he changes his mind a lot. Help Sam write a function insertAfter() that takes five parameters and inserts the name of a Pokemon right after a specific index. Function specifications Name: insertAfter() Parameters (Your function should accept these parameters IN THIS ORDER): input_strings string: The array containing strings num_elements int: The number of elements that are currently stored in the array arr_size int: The number of elements that can be stored in the array index int: The location to insert a new string. Note that the new string should be inserted after this location. string_to_insert string: The new string to be inserted into the array Return Value: bool: true: If the string is successfully inserted into the array false: If the array is full If the index value exceeds the size of the arrayarrow_forwardUse C++arrow_forwardc++problemarrow_forward
- Write in C++ 1. Define a struct for a soccer player that stores their name, jersey number, and total points scored. 2.Using the struct in #1, write a function that takes an array of soccer players and its size as arguments and returns the average number of points scored by the players. 3.Using the struct in #1, write a function that takes an array of soccer players and its size as arguments and returns the index of the player who scored the most points. 4.Using the struct in #1, write a function that sorts an array of soccer players by name. 5.Using the struct in #1, write a function that takes an (unsorted) array of soccer players and its size and a number as arguments, and returns the name of the soccer player with that number. It should not do any extra unnecessary work. 6.Define a function to find a given target value in an array, but use pointer notation rather than array notation whenever possible. 7.Write a swap function, that swaps the values of two variables in main, but use…arrow_forwardWrite a program in C as follows:- Create an array of integers named “toy” that has 120 rows and 4 columns.- The program should repeatedly display the following menu:A or a to add a toy to the bagV or v to calculate and display the total value of the toysW or w to calculate and display the total weight of the toysD or d to delete a toy from the arrayM or m to calculate and display the number of small toysN or n to calculate and display the number of medium toysL or l to calculate and display the number of large toysX or x to start filling a new bagP or p to exit program - Santa’s bag can hold 30 large toys or 60 medium toys or 120 small toys or any combination ofsizes that satisfy this requirement (ex: 29 large + 1 medium + 2 small would be max capacity).Also, the total weight of toys cannot exceed 620 Kgs. All values are entered in centimeters andgrams. (Hint: the return values of the size function should help you in calculating the bagcapacity.)The…arrow_forwardI wrote this code in c programming. what this code should do is ask how many times its going to run and run that many times(this works), ask how many books there are in a place(this works), then ask the max number of pages you want to read(this works), then asks how many pages there are in a book and put that into an array(works), then sorts the array of pages(works), and then adds the number in the array until you cant which is less than or equal to the max number of pages you want to read, and puts how many books you read(does not work), and then prints out how many books you read. a sample input is 35 206 12 3 10 25 2112 3 6 10 210 319 6 6 3 8 2 12 15 13 7 sample out put should be 345 #include <stdio.h> #include <stdlib.h> void MergeSort(int values[], int start, int end); void Merge(int values[], int start, int middle, int end); void add(int pages[], int count[], long long maxPages, long long total); void Print_Array(int count[], int cases); int main(void) {…arrow_forward
- Programing C Just with #include Matrix Addition and Subtraction (Associatively) Write a program that performs matrices addition and subtraction. As shown in the example below, you have to ask the user for the number of rows and number of columns that both matrices should have (they both have to be the same size, that is why you only ask once). You will then ask the user for the values of each matrix. Then, you will print the values that the user inputted, the added values of both matrices, and the subtracted values (matrix 2 should be subtracted from matrix 1). In this challenge Guidelines/steps: • The number of rows and the number of columns should be global variables. • Once you get these two from the user, you should declare your two matrices in main. • Then, from main, you will call function aaa twice; first, you will send matrix 1 and populate it with values inputted by the user. You will call the function a second time, send matrix 2 and populate it. In other words, function aaa…arrow_forwardOne dimension array in C:Create an array of 100 integer elements and initialize the array elements to zero.Populate the array (using a for loop) with the values 10,20,30,..., 990,1000.Write code (using for loops) to sum all the elements and output the sum to the screen. without using #definearrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- 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
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education