15,540 Topics

Member Avatar for
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
203
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
119
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
139
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
105
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
286
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
268
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
107
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
90
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
924
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
249
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
102
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
165
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
Member Avatar for sivakrishna
Member Avatar for sunderam

Hi, I need to meaure contrast for an image. Does anyone has any code snippet/documentation that i could use. I have tried looking around alot but couldnt find anything substantial thanks Sunderam

Member Avatar for Salem
0
104
Member Avatar for programmer321

[code] Hello, Please guide me to write how to write a C code for converting Unicodes (like 0905 for अ). the output i.e. अ should be written to a text file. Regards. [/code]

Member Avatar for programmer321
0
239
Member Avatar for NiNTENDU

Sorry for bother you with this dumb questions... I understand very well math but I'm a noob in C... Hope to "evolve" :( Anyway I manipulate a simple binary tree this way: [CODE=C] typedef struct _node *tree; struct _node { char *name; double val; tree left; tree right; }; void …

Member Avatar for NiNTENDU
0
86
Member Avatar for fishwater00

I do not know how to express the array I am going to work with, but some codes can describe them. If I define an array and a struct with member : [code=c] float velocity; MODEL.VELOCITY; [/code] VELOCITY in struct MODEL is also float. then I alocate memory for them; …

Member Avatar for jephthah
0
126
Member Avatar for ramya_bugbuster

hi friends.. how to compare 3 number without using relational operator? do u have any idea?

Member Avatar for jephthah
0
111
Member Avatar for NiNTENDU

Hi, it's me again... I've some problems understanding why my program hang up; I've this code: [CODE=C] #include <stdio.h> void foo ( char **bar ) { *bar = "foobar"; /* Runs perfectly */ **bar = 'b'; /* Cause a crash */ } int main() { char *bar; foo ( &bar …

Member Avatar for NiNTENDU
0
144
Member Avatar for singal.mayank

hello.. I m designing a STATISTICAL SUMMARIZER in C.. This software will create the summary of a text file submitted by the user.. The first step is to separate sentences in the text file.. I hav almost completed this step.. but there are some limitations.. Suppose if text file hav …

Member Avatar for jephthah
0
114
Member Avatar for singal.mayank

hello.. I m designing a STATISTICAL SUMMARIZER in C.. This software will create the summary of a text file submitted by the user.. The first step is to separate line in the text file.. I hav almost completed this step.. but there are some limitations.. Suppose if text file hav …

Member Avatar for singal.mayank
0
161
Member Avatar for fddrummer06

I have a code for a doubly linked list, and I need to print it in reverse. I can't seem to figure out what I'm doing wrong, or maybe I just don't fully understand what I'm doing. The part that I'm questioning is in the printList function. The while statement …

Member Avatar for Ancient Dragon
0
121
Member Avatar for nelledawg

Ok so here is the code I've written already, as well as the errors I get when I try to build. Please help me figure out what the problem is! [code=c] #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #define COMPANY "Rocklin Realty" #define TRUE 1 #define TAB 25 void …

Member Avatar for jephthah
1
260

The End.