- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
6 Posted Topics
I found the following logic for binary search from the standard book i feel it fails in some /* binsearch: find x in v[0] <= v[1] <= ... <= v[n-1] */ int binsearch(int x, int v[], int n) { int low, high, mid; low = 0; high = n - … | |
Hi all, Suppose if I write two programs of same functionality but with different methods and want to measure the run time efficiency how do i know? I mean to say i want to measure the run time of each code how do i do it? Should i check the … | |
I am very confused with the following thing #include <stdio.h> int main(void) { int array[3]={1,2,3}; int (*p)[3]; p = &array; /* Here p contians address of the array */ return 0; } Here p contains the adddress of the array. I am very confused why *p does not give me … | |
Hi all, I have implemented a sort of circular buffer in C for embedded system the code is something like this #define BUFFER_LENGTH 25 UINT8_T array[BUFFER_LENGTH]; UINT8_T increment_interrupt; void interrupt(void) { increment_interrupt++; array[increment_interrupt] = data; if(increment_interrupt == 25) increment_interrupt = 0; } UINT8_T g_old_Index_u8=0; UINT8_T g_new_Index_u8=0; void main() { g_old_Index_u8 … | |
Hi, I have this doubt i have read that "We must declare c to be a type big enough to hold any value that getchar returns We can't use char since c must be big enough to hold EOF in addition to any possible char. Therefore we use int." it … | |
Re: For the first question can i use putchar(). Can you please tell what all allowed? |