Hello,
I am trying to understand this program.
#include<stdio.h>
#include<stdlib.h>
struct node
{
int data;
struct node *next;
Type: Posts; User: skyr6546
Hello,
I am trying to understand this program.
#include<stdio.h>
#include<stdlib.h>
struct node
{
int data;
struct node *next;
Can someone clarify what's memory allocation at run time ?
When I need to write a program I write it on editor and save it. when i compile/run program. compiler allocate memory. if there is error...
I wrote code with two storage class with a single variable. test result show that we can't we have a two storage with a single variable. anyone can explain Why can't we have a two storage with a...
I understand following declarations
int one_dim[4] ; // It can store 4 variables
int two_dim[4][4] ; // It can store 16 variables
int three_dim[2][3][4] ;// it can store 24 variables
...
I am having trouble to understand How does multidimensional array store variables
No problem with 1D array
int one_dim[] = { 1,2,3 };
My understanding for 2D
#define row 3
#define...
A void pointer can hold address of any type
if the pointer know the address of another variable, then we can change the value store in that address by pointer dereference
In a code ptr hold...
41 = 4×16^1+1×16^0 = 64+1 = 65 = 'A' character
30 = 3×16^1+0×16^0 = 48 = '0' character
How to convert this technique in c code
Hello
I am working on the project where I need to send ASCII numbers to to LCD
any idea how to do convert it in main function
void LCD (unsigned char *PTR )
{
//LCD code
why getting wired result
#include<stdio.h>union u
{
int x;
char y;
float z;
}a;
why the result of print statement for a.x isn''t 1?
#include<stdio.h>
union u{ int x; char y;}a;
int main ()
{
a.x = 1;
a.y = 'A';
I set index of second array to 0
#include<stdio.h>
int main ()
{
int i;
int x[] = { 1, 2, 3, 4 };
int y[] = { 3, 4, 5, 6, 7 };
int z[9];
I don't understand what i'm doing wrong
#include<stdio.h>
int main ()
{
int i;
int x[] = { 1, 2, 3, 4 };
int y[] = { 3, 4, 5, 6, 7 };
int z[9];
I want to merge the values of two arrays
For example
x = { 1, 2, 3, 4 }
y = { 3, 4, 5, 6, 7 }
z= {1, 2, 3, 4,3,4,5,6,7}
struct Node * Add_Node( int data, struct Node *p ){
struct Node *new = malloc(sizeof(*new));
new-> value = data;
new->next = p;
printf("new : %p \n", new);
return new;
}
...
I have compiled my code codes but I do not understand what is happening from the output of the code
#include<stdio.h>
#include<stdlib.h>
struct Node{
int value;
Dynamic memory allocation means that memory can be allocated at run time.
#include<stdio.h>
struct product {
int id; /* Part number */
char * name; /* Part name ...
it say dot will use to access structure member but there is no information why the dot will only use.
Does structure variable point structure member to assign value ?
Why need a dot between structure variable and structure member ?
#include<stdio.h>
struct Point {
int x, y;
};
int main() {
Output of program
address of p : 00000000
address of p : 007113A8
address of p->x : 007113A8
value of p->x : A
value of p->x : B
address of p : 007113A8
address of p->x : 007113A8
address...
I didn't understand
p->x = 8;
I understand p is pointer and it pointing to the object x of structure. p hold the memory location of x and value stored in x is 8
my another doubts
p->x is initialized to 8 or only x is initialized to 8
p->x ; // p is a pointer to an object of struct point. it point to the object of structure x but p->x is...
I have written code to understand pointer to structure
#include<stdio.h>
#include<stdlib.h>
struct point //define structure
{
int x; //structure member type integer
I was just trying to acess the array (structure member)
Am I really following good example ?
#include<stdio.h>
struct s
{
int A[10]; //structure member
}v;
I have written code to access array element in structure
#include<stdio.h>
struct s
{
int A[10]; //structure member
}v;
Structure size = (H->n) + (H->m) + (H->N)
= 1 + 1 + 4
= 6
But compiler showing size is 8 bytes
Am I wrong in my calculation? I do not understand why it show two extra...