15,552 Topics
| |
hi all. the following is working fine for me char * hex = (..dynamically allocated memory with malloc..); *(hex+0) = 0x43; *(hex+1) = 0x2b; i now have to assign a string in the format 43 2b 1c to the char * array at runtime. anyone did it ? plz guide. | |
Hello everybody, first of all, I'm quite new to programming in C, so forgive my ignorance. For an assignment i have to program a microcontroller (Atmega8) using ICCAVR. I'm working on a programme similar to 'simon says' (where 4 led's are illuminated in a random order, and afterwards you have … | |
What im trying to do is use shared memory and increment a value in it so that i can test to see how many times i get the actual number i was looking for which is 4000000 or more/less. Im using 2 forks so that i have 2 child processes … | |
Hello guys, I'm trying to collect user input which combines integers with letters, but whenever it reaches the scanf for char it skips it and goes to next integer, could anybody explain why??? is it because main returns an integer,? I tried setting void main(void), and it sais that main … | |
Now-a-days I'm deeply interested in topics like hcking and virus.Can u suggest a link where I can create my own virus. Please help me | |
Hi, I have a problem here in the selection search because it reads the text but does not detect the position of the text like a is in the 2 position. the is in the 1 positon.... like that. But If I do this for characters it detects it. Any … | |
Okay, so my program is very close to completion. The only problem is that the program leaks memory. The deleteNode, deleteManager, and destroyList are the ones to blame, or so I think. When I delete a node other than the first one it works while leaking memory. However, when I … | |
I am trying to create multiple trees after calling tree_holder. The number of tree is unknown until compile time. Since there are many trees, and i want to access them right away just like an array. I do not use linked list since it is too slow. I have written … | |
Hi everyone, I am trying to make a program that times how long it runs for in seconds or milliseconds or whatever. The unit of time doesn't matter, I just need to know if C has any function I could use to do this. So, just as an example, I'm … | |
What sort of number does gmp.h generate - Binary or Decimal? Please need the answer a bit quickly. Thanks, Amresh. | |
Hi, I' studying various sorting techniques...And one thing I'm not clear about the complexity of the techniques... For e.g the complexity of bubble sort is Average Case=>O(n*n) Worst Case=>O(n*n) Best Case=>O(n*n) Obviously n is the no. of elements in the array... But even in the worst case i.e the array … | |
hello again i have three questions again: how can i use malloc or calloc for a two demontional arrays? is it true that A. calloc allocates memory in contiguous bytes, malloc does not ensure contiguous memory allocation? the third question which is a bit irrelevent to programming how memorey locations … | |
Hi, any body guide me a program how to convert octal to hexa decimal number using c lnaguage without using %x %o regrards, samba | |
Hi, I am sorting an double array, using qsort() #include<stdio.h> #include<stdlib.h> ... int compar( const void *arg1, const void *arg2 ) { return ( * ( double **) arg1 >= * (double** ) arg2 ); } .... int main(int argc,char *argv[]){ ... qsort(array, size_ct,sizeof(double),compar); ... } It turns out that … | |
I understand the algorithm SelectionSort, but once again my problem is the easy part( i think the college life is affecting my mind ). How in the world do you read in an unknown number of ints from a file? I thought i did it right but when i run … | |
There is something that I saw and wanted to check if it is really wrong, as I thought. In the second edition of The C Programming Language 2nd ED by Brian Kernighan and Denis Ritchie, in the section of 5.2 Complicated Declarations, in page 109, it is written so, isn't … | |
I know there are multiple threads on Matrix Multiplication but all of them are either different from what i need, or are unanswered. I am trying to multiply two N x N matrices. The two matrices and N are all found in a file via argv[1]. I have spent hours … | |
Hi, This is urgent if any one could please help me resolve the stated issue....... I know how to create cursors in ProC* and how to manipulate them. But I have to do it with a combination of C and MySql. Can any one guide me as to how the … | |
I have searched google and the forums here and I couldn't find what i need, if there is a thread somewhere just forward me to it. I am attempting to create a program that will prompt a user for a string. The program will not recognize this string to be … | |
Here is a simple substring type function that I wrote in C. [code=c] char *substr(char arr[], int pos1, int pos2) { char str[100]; char *sub; for (int i = 0; i <= (pos2 - pos1); i++) { str[i] = arr[i+pos1]; } sub = str; printf("Sub: %s\n", sub); // debugging purposes … | |
Hello..... I want to ask you something..... My teacher gave us our final exam last October 16 & 17.... I want to ask you about this question: Create a program that could show this output * *** **** ****** using while or for..... what I put in my answer sheet … | |
I'm trying to make a linked list, what's wrong with my syntax for adding a node? [code=c] struct data { char name[20]; char number[10]; }; typedef struct node { struct data list; struct node* next; } Node; Node *head = 0; Node *tail = 0; Node *New = 0; void … | |
Hey guys :) After a year of c++, teacher's announced we'll be learning C standard as well, starting with next semester. So anyway, I've been looking through some examples and exercises in a book and found 2 problems I can't seem to solve. (At least not in C). The first … | |
| |
hi, i need to create a c shared library on unix platform using korn shell. can you provide me with some sample codes please. thanks | |
EDIT for moderators: Yes that "one might think that swapbuffer is slow" was me. Heh. :D Could someone change the topicname to "Optimizing OpenGL"? Thanks. Hey guys, I'm trying to optimize this OpenGL program, so the problem isn't C, but the program is. The program loads a vanilla WaveFront .obj … | |
Hi All, Can anyone tell me about a library that helps me to read contents from /etc/resolv.conf file and also update the same file with new entries. Does this possible with Resolver library routines? Any useful links or sample programs regarding this? Thanks in advance. Renjith | |
Hi. This is NOT a homework assignment (self-interest only). The exercise asks me to write a function which accepts two strings and returns a pointer to the longer of the two. [code language="C"] #include <stdio.h> #include <stdlib.h> char* longer( char str1[], char str2[] ); char* str_ptr; int main( void ) … | |
Hi, In this piece of code in my program I am receiving the following error request for member âyâ in something not a structure or union. [code=c]struct intpair { int x ; int y ; } ; struct intpair makeintpair(int x, int y) { struct intpair temp ; temp.x = … | |
i am designing a code that will calculate tomorrows date but there is some problem with the code, when i enter year = 2008 or anyother month =12 day = 31 it gives tmorrows date as 1/2/2008 please help and tell me if i can do more improvements thanks [CODE]#include<conio.h> … |
The End.