15,551 Topics

Member Avatar for
Member Avatar for java_girl

Hi. The objective is to sort an array of doubles. My effort is listed below: [CODE=C] #include <stdio.h> #define MAX 10 void sort( double* n[], int q ); void print_nums( double* n[], int q ); int main( void ) { double* nums[MAX]; int i; for( i = 0; i < …

Member Avatar for ssharish2005
0
988
Member Avatar for raja289

[code=c] #include<stdio.h> #include<string.h> float avg(float); main() { FILE *p[2]; int k,students=10,subjects=4,i,j,id_number,date_of_birth,fail=0; float marks[100],total=0,avg; char name[30],course_enrolled[30],filename[10]; for(i=1;i<=2;i++) { printf("filename"); scanf("%s",&filename); p[i]=fopen(filename,"w"); printf("Enter Name of Student\n",p[i]); fscanf(stdin,"%s",&name,p[i]); printf("Enter Course In Which Student Is Enrolled\n",p[i]); fscanf(stdin,"%s",&course_enrolled,p[i]); printf("Enter ID Number Of %s Enrolled in Course %s\n",name,course_enrolled,p[i]); fscanf(stdin,"%d",&id_number,p[i]); printf("Enter Date Of Birth Of %s Enrolled …

Member Avatar for Ancient Dragon
0
149
Member Avatar for goodsp_007

please tell any website for study of hexadecimal objective programs or Questions in C.

Member Avatar for Salem
0
49
Member Avatar for mimsc

Hello, I'm normally the Java programmer here, but we got some old stuff running Pro*C.....anyway this is my error: myprops.c: In function `my_setupPropertyCursor': myprops.c:10931: error: called object is not a function Here's the code: [code=c] /*================================================================ Name: mylibprops.c Compile myprops to include this code. 10/29/04 -- MG -- Convert to …

Member Avatar for Dave Sinkula
0
548
Member Avatar for ashalina

I'm unable to make these programs and have to submit on thursday!!:'( [COLOR="Red"]Q. Make a header file that contains the function definitions of all the function prototypes defined below: • int strlen(char *); • void strcpy (char*, char*); • void strcat(char *, char *);[/COLOR] [COLOR="Red"]Q.Using unions, write a program that …

Member Avatar for Narue
0
83
Member Avatar for Brent.tc

Wow. It's kinda strange to even consider that I am taking part in the creation of an operating system... It really wasn't that long ago that I wasn't even capable of writing a functional program... I owe a good portion of my achievements to you posters here on DANIWEB (especially …

Member Avatar for Brent.tc
0
92
Member Avatar for java_girl

Hi. Objective: Write a program that declares a 12*12 array of characters. Place Xs in every other element. Use a pointer to the array to print the values to the screen in a grid format. Listed below is my non-functional attempt. Any help would be most appreciated. Thanks, Molly [CODE=C] …

Member Avatar for Dave Sinkula
0
120
Member Avatar for arun0107

[code=c] typedef struct _node{ char *name; char *desc; struct _node *next; }node; #define HASHSIZE 101 static node* hashtab[HASHSIZE]; char* m_strdup(char *o){ // the m_strdup function....... int l=strlen(o)+1; char *ns=(char*)malloc(l*sizeof(char)); strcpy(ns,o); if(ns==NULL) return NULL; else return ns; } int install(char* name,char* desc){ unsigned int hi; node* np; if((np=lookup(name))==NULL){ hi=hash(name); np=(node*)malloc(sizeof(node)); if(np==NULL) …

Member Avatar for Prabakar
0
158
Member Avatar for champnim

Hi I have to make a C program which has to perform a specified event at a specified time. Something like this... [code] Print Hello at 13:15 Print Bye at 14:20 Print working at 13:57 [/code] Assume that these instructions are already available. I am thinking of creating a doubly …

Member Avatar for Narue
0
88
Member Avatar for beatlea

Hello, Could you explain me what this statement means? I am confused with k/=2 as iteration statement. [icode] for (int k = p; k > 0; k /= 2) [/icode] Thanks

Member Avatar for beatlea
0
116
Member Avatar for SwiftDeath

I am creating a new sorting algorithm as a machine problem and i encounter difficulties. The logic of my said the said algorithm is to create an array by inputing the total numbers to be accepted followed by the array variables and sorting it ascending or descending. The array would …

Member Avatar for SwiftDeath
0
228
Member Avatar for triadR

hi all, i've a problem in converting struct into short here's the code i'm using, but it's still error while i'm running it. [CODE] typedef struct ip_header; unsigned short *temp; memcpy(temp, &ip_header, sizeof(ip_header)); [/CODE] any help will be greatly appreciated. thx.

Member Avatar for jephthah
0
215
Member Avatar for Sa_FF

how can i put the filename get in scanf("%s", &filename); in fopen("filename.txt", "a"); [CODE=c] main() { FILE *file; . . . printf("type the filename (.txt): "); scanf("%s", &filename); file = fopen("filename.txt", "a"); fprintf(file, "..."); fclose(file); . . . } [/CODE]

Member Avatar for Sa_FF
0
210
Member Avatar for Sa_FF

i'm trying to print the suits of the cards [CODE=c]typedef enum{diamonds, spades, hearts, clubs}SUIT; typedef struct{ SUIT suit; int value; }CARD; typedef struct{ CARD *cards[52]; int atual; /*indicates the next card to be withdrawal of the deck*/ }DECK; typedef struct{ char name[30]; CARD hand[3]; CARD biggest_card; int num_victories; }PLAYER; switch(suit) …

Member Avatar for Salem
0
120
Member Avatar for Sa_FF

how can i sort in decreasing order? i did the sort is in increasing order [CODE=c] typedef struct{ char name[30]; CARd hand[3]; CARd biggest_card; int nro_victories; }PLAYER; PLAYER h; int m, i, j, k; for(i=0; i<n_playeres-1; i++) { k = j; m = h[i].nro_victories; for(j=i+1; j<n_players; j++) { if(h[j].nro_victories < …

Member Avatar for Sa_FF
0
143
Member Avatar for pidven

i learnt c language but iam not aware of practical applications of c.how this can be used in development of any softwares,webdesigning ,or creating a virus or destroing a virus.can any one show any one practcally so i can be aware of and i will try in furthur applictions. thankingyou.............

Member Avatar for Luckychap
0
108
Member Avatar for jirving

i need help on my homework problem. i have done the operations part (+, -, *, /, sqrt) but i am really having a [B]problem on making my calculator accurate up to 40 digits and to truncate all the non-significant zeroes on the output[/B]. i don't know what data type …

Member Avatar for Adak
0
288
Member Avatar for raddix

I have a quick questions regarding a a certain style of coding I have seen that I found to be rather unique. It entails including C files within a program to allow for easy changes of constants and other variables on the fly. This method is used because of the …

Member Avatar for dwks
0
155
Member Avatar for shriagni

how can i convert string os size[10] to float. also i cannot use atof or sscanf. im asked to use bitwise or anyother methos which will take less processiong time. is there anyway. thank you

Member Avatar for Prabakar
0
272
Member Avatar for rob_xx17

hello, I think I have a rather straightforward problem, but I'm relatively new to C. I have an input file that looks like this: [code] 0.682448 0.53791 0.61727 0.48714 0.297144 0.29688 0.40549 0.68233 0.426100 0.62057 0.25095 0.54782 0.673007 0.51040 0.25476 0.35149 0.641339 0.49815 0.54557 0.42673 0.268030 0.38949 0.48841 0.56580 ... …

Member Avatar for Prabakar
0
121
Member Avatar for stephen3200

I am currently experimenting with function pointers as part of a larger project. Drawing from both online sources and textbooks. The problem however is that after storing the values as an array, when i call them the functions either fail to be called, or if i attempt to print the …

Member Avatar for stephen3200
0
108
Member Avatar for ozaidum

I'm wondering how to do this in C: (i need this for my project)... how to replace this line [URL="http://img368.imageshack.us/img368/7854/sp326rt3.jpg"]http://img368.imageshack.us/img368/7854/sp326rt3.jpg[/URL] with a printf & scanf statement? i want to hide those lines and it will be replaced with another statement. and how to make the screen window fixed (meaning not …

Member Avatar for Narue
0
92
Member Avatar for newbiecoderguy

I want this program to calculate an actors age at the time a movie they made was released, the user inputs all the data... I dont know C just learning but this is the layout I thought of any help would be appreciated, this does not compile [CODE]#include <stdio.h> int …

Member Avatar for newbiecoderguy
0
945
Member Avatar for patel_anks

Hi can anyone help me, I am learning the language C but need some help writting some code. what i need to do is from the input of the keyboard i need to find the max and min of some values and out put them. what i got so far …

Member Avatar for patel_anks
0
110
Member Avatar for johnray31

Hello friends, Could someone tell me if i want to read a particular text from a file that exist in each line of file. How could i do this? My text is like this: poll mail.telesys.com protocol POP3 user [email]vipin@gmail.com[/email] password abcd mda "cat > /export/home/m7istp/imcp/bin/ml201.txt now i want to …

Member Avatar for Duoas
0
128
Member Avatar for Sa_FF

i'm trying to do a biggest card game in c but i'm reciving some errors that i can't figure out please help me... the functions are separeted of the main(project) i'm receving the error 'incompatible types in assignment' in the function compare card [CODE=c] /*This function compares card1 with card2 …

Member Avatar for Ancient Dragon
0
262
Member Avatar for xlx16

i want to make a text programe ,this program supposed to have a text mode and a command mode; in text mode you can type and whit arrow key change your position in command mode by typing your comman you can get the results for example: by typing copy 2 …

Member Avatar for Adak
0
142
Member Avatar for HLA91

Hi Guys This has been going on for a while but now I have finally decided to do something about it. A few weeks ago I compiled a small C program from a book I was reading. It compiled fine but I wanted to make a slight change to the …

Member Avatar for HLA91
0
104
Member Avatar for red devils

Hi, i'm new to C programming and i could use some help with an assignment. i would like to store a word in a linked list, with each letter of the word in a separate node of the linked list. i would then like to traverse the linked list to …

Member Avatar for red devils
0
167
Member Avatar for michinobu_zoned

Take the following code: [code]#include <stdlib.h> int main(int argc, char **argv, char **envp) { int sum; atoi(&argv[1]);//statement with no effect. Passing argument 1 of ‘atoi’ from incompatible pointer type atoi(&argv[2]);//statement with no effect. Passing argument 1 of ‘atoi’ from incompatible pointer type sum = argv[1]+argv[2]; //error: invalid operands to binary …

Member Avatar for dwks
0
2K

The End.