15,550 Topics

Member Avatar for
Member Avatar for vgd

[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 …

Member Avatar for Ancient Dragon
0
117
Member Avatar for ChosenOreo

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 …

Member Avatar for abhimanipal
0
175
Member Avatar for pcmaster

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 …

Member Avatar for abhimanipal
0
204
Member Avatar for gman1991

[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 …

Member Avatar for abhimanipal
0
160
Member Avatar for fpm777

[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; } } …

Member Avatar for abhimanipal
0
110
Member Avatar for patrick k

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 …

Member Avatar for TrustyTony
0
288
Member Avatar for anjoz

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 …

Member Avatar for Narue
0
2K
Member Avatar for vedro-compota

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 …

Member Avatar for vedro-compota
0
516
Member Avatar for focusedmm

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 …

Member Avatar for L7Sqr
0
116
Member Avatar for quetzal_7

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, …

Member Avatar for Ancient Dragon
0
205
Member Avatar for Web_Sailor

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 …

Member Avatar for raptr_dflo
0
3K
Member Avatar for thetwig

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 …

Member Avatar for WaltP
0
214
Member Avatar for Improzigw

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 …

Member Avatar for yan0
0
279
Member Avatar for simply_viks

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 …

Member Avatar for simply_viks
0
266
Member Avatar for sajay

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 …

Member Avatar for sajay
0
187
Member Avatar for Ymor

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() { …

Member Avatar for WaltP
0
237
Member Avatar for jl.lakhnai
Member Avatar for WaltP
0
58
Member Avatar for thetwig

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] = …

Member Avatar for thetwig
0
204
Member Avatar for mwjones

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, …

Member Avatar for mwjones
0
171
Member Avatar for tubby123

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 …

Member Avatar for ravenous
0
203
Member Avatar for Falcon143

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).

Member Avatar for ravenous
0
41
Member Avatar for Purlox

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, …

Member Avatar for WaltP
0
136
Member Avatar for TrustyTony

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 …

Member Avatar for Narue
0
1K
Member Avatar for NickPatton

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 …

Member Avatar for NickPatton
0
273
Member Avatar for yashsaxena

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?

Member Avatar for WaltP
0
1K
Member Avatar for darkdai

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> …

Member Avatar for Narue
0
110
Member Avatar for vyrte

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]

Member Avatar for Ancient Dragon
1
93
Member Avatar for EarendurRingern

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, …

Member Avatar for raptr_dflo
0
1K
Member Avatar for tagazin

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 …

Member Avatar for tagazin
0
155
Member Avatar for can_surmeli

Hi. I've a BST created for an address book application for my term project. When inserting into the BST, I insert items sorted by their first names in ascending order. The thing is that the user should be able to display the BST in the ascending form of last names …

Member Avatar for TrustyTony
0
704

The End.