I need help with my C coding homework. If possible can you
please comment to help me understand whats going on in the code.
Thanks in advance. 
//Gaurav ponkiya
//Core concept of this program is to understand pointer
//09-nov-18
#include<stdio.h>
int main()
{
int a=5,b=6;//Two int variable with different values
int *p1,*p2,*p3;
p1=p2=&a;
p3=&b;
printf("Initial value of two integers are a=5,b=6\n");
printf("Memory Address=%d\nValue=%d\n",p1,*p1);
printf("Memory Address=%d\nValue=%d\n",p3,*p3);
printf("Content of all pointers\nFirst pointer points
to->%d\nSecond pointer points to->%d\nthird pointer points
to->%d\n",*p1,*p2,*p3);
printf("Memory location points by Each
pointer\np1=%d\np2=%d\np3=%d\n",p1,p2,p3);
a=8;//change the value of first variable
printf("value of first variable=%d\n",*p1);
*p3=10;//changing value which is pointed by third pointer
printf("Memory location the third pointer points to is
%d\n",p3);
printf("Value of second variable=%d",*p3);
return 0;
}
I need help with my C coding homework. If possible can you please comment to help...
Please code in c
1. Write a program which does the following: Declare and initialize three pointers. One points to an integer, one points to a float and one points to a character variable Ask the user to enter appropriate values for these variables. Output the values to the screen by accessing the variables directly and then by using pointer references. Print the address of each variable. Modify the variables by performing any arithmetic operation only using pointer refer- ences...
Lab 8 CS102 Lab 8 Hands on programming with Pointers The goal of this lab exercise is to apply the knowledge of pointers and File input output operations. Program 1 Short description: Declare, initialize and use pointers for different data types. Detailed Description: Declare 4 variables of type's int, float, double and char respectively and initialize them to some logically correct values. Declare pointers to all these variables. Initialize the pointers to point to these variables respectively Print the values...
Please help with this C++ code. If possible comment the code and please send screenshots of the code. This assignment involves creating a program to track employee information. Keep the following information on an employee: Employee ID (string) Last name (string) First Name (string) Birth date (string as MM/DD/YYYY) Gender (M or F, single character) Start date (string as MM/DD/YYYY) Salary per year (double) Thus you must create a class that has all of this, and get/set methods for each...
Hello I need help with this program. Should programmed in C!
Program 2: Sorting with Pointers Sometimes we're given an array of data that we need to be able to view in sorted order while leaving the original order unchanged. In such cases we could sort the data set, but then we would lose the information contained in the original order. We need a better solution. One solution might be to create a duplicate of the data set, perhaps make...
C
program
Main topics: Files Program Specification: For this assignment, you need only write a single-file C program. Your program will: Define the following C structure sample typedef struct int sarray size; the number of elements in this sanple's array floatsarray the sample's array of values sample Each sample holds a variable number of values, all taken together constitute a Sample Point Write a separate function to Read a file of delimited Sample Points into an array of pointers to...
I need help with my coding for C++! The goal of this is to calculate the total cost of a product by combining the products price and the amount of tax, then display it to the user. The numbers we have to test out is 100 for the price and 8.25 for the percentage. When I test is out, the formula works but it isn't rounding the 108.25 to 108.3, which is the total price we are supposed to display...
PYTHON CODING HELP: BELOW ARE THE STEPS I NEED HELP WITH PLEASE. :) First create a text file named "items.txt" that has the following data in this order: Potatoes Tomatoes Carrots ... and have it be in the same directory as the Python program you are coding for this assignment. IMPORTANT: Your program should work with any size file. It should work with 100 items listed or with no items in the file! Write a Python program that ... 1....
I need help doing the requirements listed below. Please don't delete comments. #include #include #include #include "Imager.h" /// 5 points : The program compiles without errors and warnings /// 5 points : The program operates correctly using namespace std; int main() { /// 2 points: Create an instance of two integers called "inX" and "inY". /// 2 points: Create an instance of the Imager class called "myImager". /// 2 points: Create a file input stream called "fileInStream". /// 2 points:...
C++. Please note the BOLDED ITEMS. You will create a simple linked structure. You will use a simple node that has a pointer to a Node. The data for the Node will be a single data member of type char. You will build a structure where the last node you add will point to the first node created, i.e. it will be a circular linked structure. You will create a program that stores characters provided by the user, stored in...
Need help about C PROGRAMMING,, pls use only C LANGUAGE.., yea so
im doing this exercise as a practice for c programming, could
someone do this as well so i could compare if my code makes makes
sense and to see and help correct the errors im getting right
now..
Any helpful help would be appreciated..
Pointers &Pointer arithmetic Memory allocation and freeing Main topics: Exercise This lab is designed to give you practice working with pointers and memory allocation...