15,550 Topics

Member Avatar for
Member Avatar for digital-ether

I've written an Object Cache in PHP. [url]http://code.google.com/p/php-object-cache/[/url] However, it requires PHP Sockets support which is not available on a lot of PHP builds. Coming to the conclusion that all hosting that support PHP should support C, I'm going to rewrite this in C. The PHP source is here: [url]http://code.google.com/p/php-object-cache/source/browse/trunk/socket.class.php[/url] …

Member Avatar for jephthah
0
164
Member Avatar for nyks.up

Create a text file on desktop as “text.txt”, content of file will be a single line as “FILE ORGANIZATION AND ACCESS METHODS”. Write a program to read from file only “ORGANIZATION” word and print it on screen. And i am doing that but it does not work . [code=c] #include …

Member Avatar for nyks.up
0
84
Member Avatar for DoEds

[i][color=#33CCFF]/*Help me finished this code.I trying to make a program that will ask 2 choices. 1 is for converting dollars to peso and 2 is for converiting peso to dollars. Im trying my best but i dont seem to get the right code for it. Im just a beginner in …

Member Avatar for Tom Gunn
0
335
Member Avatar for kostasxx

i cant understand why this happens i m making a simple implentation of sieve of eratosthenes algorithm but code doesnt run on gcc [code] // calculate primes from 1 to 100 #include <stdio.h> #include <math.h> int main() { unsigned long i,x[99],w; for ( i=1; i<100; i++ ) { x[i] = …

Member Avatar for kostasxx
0
88
Member Avatar for warp

Hi Please look at this small piece of code: [code] char* pArray = new someArray[128]; delete pArray; deleta[] pArray; [/code] Will this generate a mem leak? "delete pArray" wil deallocate only the first char of someArray but will "delete[] pArray" deallocate the rest of someArray or will the compiler see …

Member Avatar for warp
0
119
Member Avatar for akulkarni

i know how to find palindrome and also how to find reverse of string using for loop. but i wish to do it within a loop (for) using flag. can u please tell me how to use flag in c . my code is as follows [code] #include<stdio.h> #include<conio.h> #include<string.h> …

Member Avatar for csurfer
0
8K
Member Avatar for dilip.mathews

Hi all, Can anybody tell me how to calculate the order of a recursive function. Lets take factorial function. Without using recursion [COLOR=blue]int x =1;[/COLOR] [COLOR=blue]for(int i = 1;i<=n;i++)[/COLOR] [COLOR=blue] x = x*i;[/COLOR] In this case the order will the O(n) in terms of time and in terms of space …

Member Avatar for mvmalderen
0
243
Member Avatar for johnray31

Hi guys!! I am wondering how below given program is working. in function func1 how return (void *)y working. [CODE] #include<stdio.h> void * func1() { int y; y = 10; return (void *)y; } int main() { void *x = 0x00; x = func1(); if(x == NULL) { printf("error\n"); } …

Member Avatar for johnray31
0
138
Member Avatar for Hiroshe

Hey guy's. Can't get this seemingly simple function to work. It is suppost to get a string and return the first 10 characters, than the next time you call it, it returns the second 10 cheracters and so on. I did this in basic a while ago without problems, C …

Member Avatar for Hiroshe
0
139
Member Avatar for MrNoob

Hello people i got a h.w to do Using nested loops to produce the following pattern: F FE FED FEDC FEDCB FEDCBA I had idea to do it but that will require array and strlen(char first int of the outer loop) and the thing says that I must do it …

Member Avatar for MrNoob
0
222
Member Avatar for kostasxx

can anyone tell me how to achieve this? its the first time i use gmp, i cant really understand what i should use and how lets say we have x1= 5*100; x2=10*10; can anyone show me the code that adds those numbers and prints the result? thanks

Member Avatar for mvmalderen
0
318
Member Avatar for Raza Najam

I have names of certain students and their ages stored in a text file 'records.txt'. LIKE: John 22 Paul 21 Sam 24 Harry 23 Now i want to store these ages and names in a structure 'records(r)' directly from the file. (Here i am not taking any input from the …

Member Avatar for Hiroshe
0
91
Member Avatar for Meldroz

Hey, i'm not too familiar with c and i need to write a hashing program that takes in a int and a a string. I'm trying to use separate chaining. ok here's my hash function, basic one: int hash(int key ) { return key mod TableSIZE } here's my stuct …

Member Avatar for jephthah
0
324
Member Avatar for Pramoda.M.A

Hi All, I am using Visal Studio 2005. I couldnt understand how Visual Studio is executing follwing code. Can anybody please tel me. I have worked on Turbo C compiler, VC++ compiler and Visual studio. I could understand the output of other two compilers for the following code. But i …

Member Avatar for csurfer
0
147
Member Avatar for paroshm

Hi I'm working with a structure like this: [code=c] struct table{ int id, rank, hop_sup; float dist,bs_dist, res_enrg, total; }; struct nd{ float x,y, enrg, bsdist; int id,my_rank, hop; int neighbor[50], prfrdnbor; float nbordist[50]; struct table nbr[25]; }node[127]; [/code] Do you think this would cause memory problem? In my program, …

Member Avatar for mvmalderen
0
130
Member Avatar for StaticShell

Hello all, I am new and I was hoping someone could please help me out. My problem is, I am trying to design a C program to read in a text file containing values, and output these values in binary form. the text file "values.txt" looks like this: 139 <tab> …

Member Avatar for StaticShell
0
154
Member Avatar for Hiroshe

Writting a program which involves tallying generated numbers. I'm having problems with the tallying part. It takes a number, and finds it in the second row of an array, and tallies (add 1) to the same position in the first row. Here's my extracted code: [CODE=C]#include <stdio.h> void tally(int number, …

Member Avatar for Hiroshe
0
1K
Member Avatar for xyzt

In a book, I saw a definition like this: [CODE]static struct map_info mymap = { .name = “mymap”, .phys = FLASH_START_ADDR, .size = FLASH_LENGHT, .bankwidth = FLASH_WIDTH, };[/CODE] what does it mean..?It's not clear for me actually..

Member Avatar for mvmalderen
0
130
Member Avatar for Jim_b

Looking at using resource files. using Watcom c. Using the Watcom resource editor I output *.res and *.DLG files Any hints on how I produce a *.rc file?

Member Avatar for Ancient Dragon
0
82
Member Avatar for kris4th

I need to create a program that adds two sets, hint: the set is composed of distinct (integer) How to do this using this Function: void add(int result[],int item,int *count); add result the value of the item. Please i really need ur immediate help...pls600x

Member Avatar for csurfer
0
128
Member Avatar for sam511

hello people, I have a problem in sorting linked list according to id number of student in secondary school system ,the code is not working .can any body help me please ?!! Here Is my code. [CODE] void sortbyID() { struct school *pre; struct school *move; move=head; pre=move; move=move->next; while …

Member Avatar for s_sridhar
-1
83
Member Avatar for art-1001

Build a program in C that accomplishes the following task: It reads from a file the names of some certain files and their size in MB, then it distributes these files to some folders each with a maximum of N MB. The way of distribution is such that a minimum …

Member Avatar for mvmalderen
0
92
Member Avatar for sam511

hello. In my project the students are added into two levels(1 & 2) each level has it's own linked list so if you choose to add a student in level 1 it will be added to list1, if you choose to add him in level 2 it will be added …

Member Avatar for s_sridhar
0
252
Member Avatar for sam511

hi , I'm trying to store linked list in a file . I opened a file with extension txt but when I opened it to read it . It was encrypted does anyone know why??

Member Avatar for kvprajapati
0
88
Member Avatar for salesman91

hi, I m making a graph with all (x,y) printed on graph line..like from +x=1,2,3....so on and same with -x,+y,-y. below I tried u can try this too but I want clean graph with nos. on it. can someone solve it? [code]#include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> int …

Member Avatar for salesman91
0
105
Member Avatar for sam511

HI everyone. :) .I hope you can help me my function . I want the user to enter number of level "There are two levels" and then display students records in that level sorted by id .the one I wrote sorts then displays so the output is wrong .I tried …

Member Avatar for sam511
0
80
Member Avatar for bahr_alhalak

hello every body i have a problem with a c program . the question that ( [COLOR="Green"]write a c program that reads a real numbers untill error then calculate the sum and the average of all numbers [/COLOR]) i have solve it with a while looping . and i need …

Member Avatar for bahr_alhalak
0
220
Member Avatar for wendwessen

[code=c] #include<stdio.h> // Global variable declaration and initialization. can be used every where in the program body. static char grid[3][3] ={{' ',' ',' '}, {' ',' ',' '}, {' ',' ',' '} }; void Print()//--- to print the grid. prints the grid. { int i, j; printf("\t-------------\n"); for(i = 0; …

Member Avatar for wildgoose
0
115
Member Avatar for cmakesmesad

I need help with the following program I wrote. Im getting a segmentation fault and the warning "assignment makes integer from pointer without cast". Can anyone spot any errors with the program? [CODE] #include <stdio.h> #include <string.h> #define MAXLENGTH 256 //function portotype char * next_word(char *instring, char **new_start); int main …

Member Avatar for Tom Gunn
1
85
Member Avatar for kostasxx

hi guys, i have this code [code] #include <stdio.h> #include <stdlib.h> int main(){ unsigned long long *x; x = (unsigned long long*)malloc(600851475143ULL*sizeof(unsigned long long)); if (x!=NULL){ printf("success\n"); getchar(); } else { printf("fail\n"); getchar(); } printf("%I64u\n",600851475143ULL); getchar(); return 0; } [/code] this is a part of some program im trying to …

Member Avatar for Tom Gunn
0
117

The End.