# Search:

Type: Posts; User: Parth12

1. ## Thread: static variable result

by Parth12
Replies
2
Views
1,252

### static variable result

#include<stdio.h>

void foo ()
{
static int i = 0;
printf("i = %d \n", i);
i = 1;
printf("i = %d \n", i);
i = 2;
printf("i = %d \n", i);
2. ## Thread: How to set all bits in loop

by Parth12
Replies
6
Views
2,172

### given nibble i = 0000 (length 4 bits ) 0001...

given nibble i = 0000 (length 4 bits )

0001 // set first bit
0010 //set only second bit
0100 //set only third bit
1000 // set only fourth bit

How to set single bit at time as shown in...
3. ## Thread: How to set all bits in loop

by Parth12
Replies
6
Views
2,172

### I did not understand your bit shifting (1

I did not understand your bit shifting (1 << 4) - 1;

what result it (1 << 4) gives ?

What happens if I wan to shift only one bit

nibble = 0 <<1 = 0
nibble = 1 <<1 = 1
nibble = 1 <<0 = 1
4. ## Thread: How to set all bits in loop

by Parth12
Replies
6
Views
2,172

### How to set all bits in loop

I want to set all bits in loop

nibble = 0000; // bits order (4321)

nibble = nibble|nibble << 1 // set 2nd bit = 0010
nibble = nibble|nibble << 2 // set 3rd bit = 0100
nibble =...

by Parth12
Replies
4
Views
1,593

### I am confuse with following logic operation, ...

I am confuse with following logic operation, specially with shift operation
What will the final result of X

X = 0 | 0 << 0X = 0 | 0
X = 0

X = 0 | 1 << 1
X = 0 |

by Parth12
Replies
4
Views
1,593

### sorry I have updated previous question because...

sorry I have updated previous question because R1, R2, R3 create confuse so Now I am just using X, Y and Z

assume X is status of flag, Y is status of bit and z show the change of Y when flag...

by Parth12
Replies
4
Views
1,593

### logical operation

Hello

logical operation between x and y give z

X Y Z
0 0 0
0 1 1
1 0 1
1 1 1
8. ## Thread: Reverse number program

by Parth12
Replies
11
Views
2,297

### I got it #include int main ()...

I got it

#include<stdio.h>

int main ()
{
int number = 987;
int reminder;
int reverse = 0;
9. ## Thread: Reverse number program

by Parth12
Replies
11
Views
2,297

### I tried but I do not understand how to do that

I tried but I do not understand how to do that
10. ## Thread: Reverse number program

by Parth12
Replies
11
Views
2,297

### #include int main () { int...

#include<stdio.h>
int main ()
{
int number = 987;
int reminder;
int reverse = 0;

while ( number > 0 ) {
reminder = number % 10; // remainder = 987 % 10 -->...
11. ## Thread: Reverse number program

by Parth12
Replies
11
Views
2,297

### I am using % and / operator ...

I am using % and / operator

#include<stdio.h>
int main ()
{
int number = 987;
int reminder;
int reverse = 0;
12. ## Thread: Reverse number program

by Parth12
Replies
11
Views
2,297

### Normally I know How do the Reverse Number. The...

Normally I know How do the Reverse Number. The problem is that how do I implement the program ?

#include<stdio.h>

int main ()
{
int number = 987;
int reminder;
int reverse = 0;
13. ## Thread: Reverse number program

by Parth12
Replies
11
Views
2,297

### Reverse number program

If we know logic how do we write code for it

For an example

quotient = 987 / 10 --> 98
remainder = 987 % 10 --> 7 -> first number
quotient = 98 / 10 --> 9 --> third number
remainder =...
14. ## Thread: deep confuse with pointer

by Parth12
Replies
4
Views
1,767

### something better then previous ...

something better then previous

#include<stdio.h>
#include<stdlib.h>

struct structure_name
{
int i;
char c;
15. ## Thread: deep confuse with pointer

by Parth12
Replies
4
Views
1,767

### #include #include struct...

#include<stdio.h>
#include<stdlib.h>

struct structure_name
{
int i;
char c;
float f;
struct structure_name * n;
};
16. ## Thread: deep confuse with pointer

by Parth12
Replies
4
Views
1,767

### deep confuse with pointer

Hi,

I am deeply confuse with pointer after so many reading

Pointer is variable that hold memory location of variable. variable may be a different type like int, char, float..

I am confused...
17. ## Thread: Having difficulty to understand pointers

by Parth12
Replies
1
Views
1,351

### Having difficulty to understand pointers

Hi,

I am having difficulty to understand pointers in c language

I wrote my own code

#include<stdio.h>

#include<stdlib.h>
18. ## Thread: warning: return makes integer from pointer without a cast

by Parth12
Replies
11
Views
3,921

### #include int *fun ( int *p ) { ...

#include<stdio.h>

int *fun ( int *p )
{
*p = 20;

return p;
}

int main ()
19. ## Thread: warning: return makes integer from pointer without a cast

by Parth12
Replies
11
Views
3,921

### I don't have any idea how to do this int * p, ...

I don't have any idea how to do this

int * p, pointer type integer
20. ## Thread: warning: return makes integer from pointer without a cast

by Parth12
Replies
11
Views
3,921

### How to verify that function return pointer ...

How to verify that function return pointer

#include<stdio.h>

int * fun ( int *p )
{
*p = 20;

return p;
21. ## Thread: warning: return makes integer from pointer without a cast

by Parth12
Replies
11
Views
3,921

### but both 20 or 0061FF28 are integer I am...

but both 20 or 0061FF28 are integer

I am trying to make a function that takes the address of the variable and returns the address.

First example code how to get return address 0061FF28 from...
22. ## Thread: warning: return makes integer from pointer without a cast

by Parth12
Replies
11
Views
3,921

### #include int fun ( int *p ) { *p...

#include<stdio.h>
int fun ( int *p )
{
*p = 20;

return *p;
}

int main ()
{
23. ## Thread: warning: return makes integer from pointer without a cast

by Parth12
Replies
11
Views
3,921

### warning: return makes integer from pointer without a cast

Hi,

I have an error warning: return makes integer from pointer without a cast. My code below

#include<stdio.h>

int fun ( int *p )
{
*p = 20;
Results 1 to 23 of 23