15,551 Topics
| |
hi programmers!) Please help me understand this - as I understand from practice - the getting SIGALRM by process is ends the process - but I can't find the explanation of this guess. for exp. - I have code - [CODE]int main(void) { /* Установить будильник */ sleep(1); if((alarm(5)) > … | |
[CODE] struct node{ int value; struct node *next; }; void rearrange(struct node *list) {struct node *p,*q; int temp; if(!list || !list->next)return p=list;q=list->next; if(q) { temp=p->value; p->value=q->value; q->value=temp; q=p?p->next:0; } } }[/CODE] list is containing the integers 1,2,3,4,5,6,7 then the output is? also what's the meaning of p=list(as per me its … | |
Hi... At some point I would like to create an operating system. I am quite familiar with C, and I know some basic assembly. Can anyone give me ideas of applications to create to learn more about OS Design. I would buy a book, but I don't have an extraordinary … | |
Although I am very good with html, css and a little at php,javascript and mysql, i still can't manage to get interested or start learning basic programming. To be honest, i barely know anything about c or c++ since i skipped basic programming and proceeded to learn right away php,javascript … | |
[CODE]// this is the grading sorting program for part one #include <stdio.h> int main(int argc, char **argv) { FILE *fp; // file pointer, points to the file char file_name[32]; // store file name int ID[50]; int grade[50]; int a,b; // index variables int student_id, grades; // opening file by asking … | |
[CODE]#include<iostream.h> #include<stdio.h> #include<string.h> void remplir(FILE *f) { char c; char fichier[20]; printf("entrer les nom du fichier:"); scanf("%s",fichier); f=fopen(fichier,"w"); if(f==NULL) printf("erreur"); else while((c=getchar())!='.') { //putc(c,f); fprintf(f,"%c",c); } } int comparer(FILE *f,FILE *fp) { char l1[10],l2[10]; printf("OOO"); while((!feof(f)) && (!feof(fp))) { fgets(l1,2,f); fgets(l2,2,fp); printf("OOO"); if(strcmp(l1,l2)) { printf("%s",l1); printf("%s",l2); return 0; } } … | |
Hi everybody, I'm trying to write a program to simulate a solitaire game that my math teacher showed me so that I can eventually get an approximate probability of winning. Although I eventually plan to simulate the game many times, I'm only going through it once at this point with … | |
Here my question I need a decoder for binary codes from a text file but the problem is when I put a space in the text file tpos values crash I know what the problem is the while(fgets(buf, 8, fb) != NULL) because some binary codes are only 6 characters … | |
Hi guys!) There's a peace of code and I can't understand - what's wrong in it - [CODE]#include <unistd.h> #include <stdio.h> #include <sys/types.h> #include <sys/wait.h> int main (void) { int status; pid_t pid; if (!fork ( )) return 1; pid = wait (&status); if (pid == -1) perror ("wait"); printf … | |
Trying to take the output and put it in a format that looks like a MAC address separated by colon looking for 0800 type field and 0806 then print the data in a useable mac address format. Any help would be appreciated. [CODE]#define RETSIGTYPE void #include <sys/types.h> #include <sys/time.h> #include … | |
Hi, help please! I have a struct containing an array of pointers to structs containing Binary Search Trees with nodes containing structs. ... <*sigh*> I hate C soo much... put work wants it to be in C. I can set the struct of BST's just fine, and keep it around, … | |
Hi, I need to create a user name and password login client server. Attached is my attempt. This is my first try on socket and network programming in C. I have reached to a certain level but just a little problem is stopping me because of less C knowledge. I … | |
hey guys heres a portion of my code, im trying to validate a users input of price and then convert it to cents before doing some other calculations. Im having problems with my validation still somehow allows letters if they are not the first digit entered. For example, a2 is … | |
Hello all I have come to you with a problem. I have an assignment where I have to make a program that stores information in Structures and the structures are held in an array. I have been working for day, I'm not a programmer thus it's going slow as hell … | |
hello. i am working on the i/p file which will have object name=value.have any no of i/ps given by user. the value has to be updated each time a new value is entered in CLI. can i overwrite the value with some greater size value????????????? without using the tepmfile??i understand … | |
Hello I'm coding an algorithm based on genetic programming with tree structures in C. I implemented tree structure using recursive structure pointers **The traditional way** [CODE] struct tree { int val; tree *left; tree *right; }; tree a[10]; tree b[20]; void main() { generate (); // this generates me 10 … | |
Ok cant get my head around this one :/ But basically i need to write a program that accpets input from a keyboard "JACK ROBINSON" then it manipulates the string to output INK SON ROB JAC... Heres what i have so far: [code] #include <stdio.h> #include <string.h> void main() { … | |
Please Help me I want to control Ubuntu through voice in c programming please reply thanks. | |
I wrote a small program to demonstrate a problem im having with a bigger one so you dont have to look thru so much code. I'm having problems when I convert a double to an integer. [CODE]#include <stdio.h> #include <stdlib.h> int main(void) { double dNum; int iNum; char sNum[15] = … | |
I'm running into a snag using the [B]_emit[/B] pseudoinstruction, but more accurately a snag using the C preprocessor. I have an array of op codes from which I want to randomly select one and _emit it into the program's code. Here is an example: [CODE]unsigned char opcodes[] = { 0x60, … | |
Guys, i have [b]2 doubts[/b] [b]Doubt-1[/b] -------- [code]int* p[10];[/code] Does it mean that 1)I have an array of 10 pointers, that means, each of them is capable of holding an address OR 2)I have a single pointer that points to an array holding 10 integers I too, feel , the … | |
Can any 1 suggest me the C code logic on 420 to 422 subsampling convertion on YUV video......(on [B]Macro block basis[/B] NOT on frame basis). | |
Is there any way of getting input directly from keyboard without it getting written onto screen? I tried the standard O/I functions, but they don't help. I also looked into C libraries, but there wasn't and useful function (unless I missed some). I need only one one key from keyboard, … | |
I did some code to refresh my C. So many things have happened since 1987, but at least I started with ANSI instead of K&R. As I used the language so little, I think it is time to do some practise and even to learn some C++ to support my … | |
I'm using sockets in C to write 10 bytes to a socket and then read 10 bytes from that socket. I create a parent process that forks, creating a child that acts as the socket server that writes the 10 bytes. After the 10 bytes are wrote, back in the … | |
Hello All I want to accept the string from user till he press "enter" key. For that I used gets() function on Windows. But the same program not run on Linux. Can any one tell me alternative for this function? | |
hi all, i have a code which searches for a string in a file, the searching works well except that it will only return that the string is found if it is the first word in the file, otherwise it will return not found. help me please [CODE] #include<stdio.h> #include<string.h> … | |
hello i have a problem in reading lines from a file.i use the following code and the printf returns null. [CODE] char* x; MAXLINE =100; char line[MAXLINE]; FILE *source; source = fopen("data.txt","r"); if (source == NULL){ printf("ERROR!!!file not found!");} while(!feof(source)){ x = fgets(line,MAXLINE,source); printf("%s\n",x);} fclose(source); [/CODE] | |
i have an assignment to write a C program suing Pointer to count the character or word found in a particular string. i already did it, but i cannot enter the word, its fine with the character. can anybody help me? thx :)[code]#include <stdio.h> #include <string.h> int main (int argc, … | |
Hello I wanna create an application that, inserted words an English and words an another one language will show you this in a random mode. Also you should be able to insert new words and carry on like this. I'm not smart enough so I got stuck. If someone would … |
The End.