When I run code, function pointer doesn't give expected output
#include <stdio.h>
void foo ( void )
{
int a;
a = 20;
Type: Posts; User: vajra11
When I run code, function pointer doesn't give expected output
#include <stdio.h>
void foo ( void )
{
int a;
a = 20;
Hi
if the register is 16 bit wide
sign, size, data type
#include <stdio.h>
int main()
Thanks for making clear. A static function is accessible only within the file it is defined in. if we want to access from the another file then we have to make function extern
I have mostly seen that the variable has a life time and scope.
But does any function also have life time and scope ?
#include<stdio.h>
void fun (void)
{
printf("sleep \n");
Hi
I want to print pattern something like
7, 8, 9, 10
4, 5, 6
2, 3
I do not understand what you mean
test.h
#ifndef TEST_H_INCLUDED#define TEST_H_INCLUDED
void Func();
#endif
test.c
There is no main function in your code It will never run
Here is my example code :
#include <stdio.h>
void Func() {
static int x = 0;
x++;
printf("%d\n", x);
}
>account->balance?
account is pointer to structure that point structure member balance
>account.balance
account is not pointer variable that point to structure member balance
#include <stdio.h>
#include<stdlib.h>
struct Name
{
int account_number; // structure member type integer
float balance; // structure member type float
};
int main ()
You are declaring a normal variable while I was declaring a pointer,
Now how we can store variable value in below code
#include <stdio.h>
struct Name
{
int account_number; //...
Its means if the structure variable is a pointer to structure type struct , it cannot store the value
I am trying to understand How pointer of structure store variable value
This is my code
#include <stdio.h>
struct Name
{
int account_number; // structure member type integer
A little hard to understand
What is the similarity and difference between global and static variable ?
similarity
Both will variables will initialize once they will not create and destroy...
I see a difference between global and static variables These two variables do the same thing. But the theory says that these two are different
#include <stdio.h>
static int i = 0;
...
No I haven't, How do I check weather my function are correct or incorrect. I would need to other function two check queue. I wanted to make three function first empty queue, enqueue and dequeue
next step, I have written code for en queue functions
#include<stdio.h>
#include <stdlib.h>
struct Node {
int data;
struct Node *next;
I want to write code for the function that create empty queue with no element
#include<stdio.h>
#include <stdlib.h>
struct Queue {
struct Node *first;
struct Node *last;
How to create fifo queue ?
I made this attempt
#include<stdio.h>
#include<stdlib.h>
struct Node
{
What do you mean ?Can you give pseudo code
Two pointers called FRONT and REAR are used to keep track of the first and last elements in the queue.
okay
This is linked list that can add new node
#include<stdio.h>#include<stdlib.h>
struct node{
int Number;
struct node *next;
};
What are the steps to create queue with linked list
Step 1 : Create a new node
Step 2 : Assign data to the data member of new node
step 2 : if queue is empty go to step 3 else go to step 4...
I understand bitwise operator in c language we can get decimal, hex input from user
Any idea how to get only 8 bit data from user to perform bitwise operations
for examples
0000 1111...
okay understood
-> A reference must always refer to something. Null are not allowed
-> A reference must be initialized when it is created
->once initialized it can not be change with another...
I tried to understand with my code
pass by pointer
#include<iostream> using namespace std;
void passbypointer(int* x)
{
*x = 20;
}