15,551 Topics
| |
hello i coding a program that need to sum array according to its num like for example num[0] will only do that and num[1] sum[1]=num[0] +num[1]; sum[2]=num[0] +num[1] +num[2]; etc i got one idea first i will fill the num array with numbers then i go through after that with … | |
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] … | |
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 … | |
[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 … | |
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] = … | |
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 … | |
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> … | |
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 … | |
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"); } … | |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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, … | |
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> … | |
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, … | |
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.. | |
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? | |
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 | |
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 … | |
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 … | |
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 … | |
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?? | |
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 … | |
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 … | |
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 … | |
[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; … | |
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 … |
The End.