15,552 Topics
| |
i am clear with the concept of Array of pointers & pointer to an Array. but i wonder what is the advantage of creating a pointer to an array though the same can be done just by using twod array with row and col indexes. please some let provide me … | |
heah pls can u send me some progmmes to my email id ie...[I]<<snip>>[/I] pls | |
Hi all, I am stuck here after several hours tried. Here the thing. I have txt file that contain float data (1 column and many row) such like this (4 float data): 0.799 0.851 0.926 1.000 Then i want to read it as array. My code is work until this … | |
1. When we create a text file by C by program copying it from other file the how can we change the path (by default its saved in BIN folder)? 2. How do we run other applications using C language (suppose Windows Media Player or HTML)? Thank You | |
Hello, [code= c] main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); } [/code] The answer to this question is 4 1 and the reasoning is that the compiler finds j to be true and hence does not need to check the remaining … | |
Hello C experts, [code=c] main() { int i=0; int x; fork(); fork(); fork(); i++; x=&i; printf("%d %x\n",i,x); } [/code] Each child process gets its own copy of i , but why does x not print different address ? | |
I have an [B]char[/B] array i.e array={2.3,5.5,8.9} how can I typecast them so I can put them to an array of type double | |
Hello i need some help with parsing a string as i'm very new to C and only started learning it a few days ago. I wish to parse the string "Jan 15 05:46:07 gateway kernel: IN=eth0 OUT= MAC=00:80:c7:c3:c7:be:08:00:03:23:2a:a8:08:00 SRC=80.232.253.76 DST=80.234.144.54 LEN=48 TOS=0x00 PREC=0x00 TTL=108 ID=43600 DF PROTO=TCP SPT=3329 DPT=135 WINDOW=16384 … | |
help.. my program closes everytime i run the combination calculator.. | |
hello! Im making a program that makes the numbers you input be divided into diffrent denominations which is in peso. example: i input: 1500 so the output will be BILL QTY 1000 1 500 1 my problem is, after it displays the output, I want the program to ask you … | |
how to find the no. of characters which are in a file in c program | |
HI! can someone help me get the codes for this program.. Im still new to TC.. heres the criteria: 1. This program is for selling bread 2.There are 4 types of bread namely a b c d and each cost 1 2 3 4 respectively 3.each bread has a stock … | |
Hello folks, I have some doubt regarding the creation of header files and libraries using C. Suppose I am defining all the functionalities related to the Stack and I wan to create it as library, for eg. stack.C which will get me the object file, Stack.o in Linux OS and … | |
Hi I am trying to read a text file which has a few lines of double values I need to go line by line and put them in several arrays ex 4.2,3.4,5.7,8.7 2.5,6.4,4.4 How can I do this in C I also need to save the values in an arrays … | |
[I]<< Thread split from [URL="http://www.daniweb.com/forums/thread29933.html"]here[/URL] >>[/I] hello.. i did not get it the programs that u wrote it.. for my own.. im looking for the factorial of the number that we entered.. for example.. 12 the factor of this is 2 2 3..that wat i want to mean.. in wat … | |
I have some code to parse POST and GET parameters passed to a CGI program written in C and I'd like to test it out. To parse GET parameters, I need to access the QUERY_STRING environment variable, so I'd like to set that environment variable to different things and see … | |
Hi, I have this problem. If the sender sends messages consecutively, like message 1 and message 2 and at the receiver attempt is made to read each message individually, then the receiver gets the both messages as the message 1. Is there any built-in mechanism such that the receiver delivers … | |
the code takes each character and stores where and how many times a roman numeral appears and the assess the integer. this is my first code im posting. anything to make the code better is most welcome. roman numeral refers to M=1000 D=500 C=100 L=50 X=10 V=5 I=1 and uses … | |
Hello, While compiling my code, I'm receiving a "Data access misaligned address violation" error. I tried to find the reason for the error, but am unable to pin point the location. I am trying to manipulate the amplitude envelope of an audio file, but this error occurs when i'm trying … | |
[CODE=c] #include<stdio.h> #include<math.h> main() { int i=0,j,c,s[100]; double t=0; while((c=getchar())!='\n') { s[i]=c; ++i; } for(j=i;j>0;--j) { t=t+(s[i-1]*(pow(16,(4-((double)i))))); --i; } printf("%d",(int)t); return 0; } [/CODE] HI, i need to write a program that converts an hexadecimal number into integer form (for convenience i'm only considering hexadecimal no. without alphabets from a … | |
if I have this code : [CODE] # node* search2(node **root, int val){ # # node* temp = *root; # if(temp -> value == val){ # printf("found!\n"); # printf("ang root nfaun ay nasa : %d \n", temp -> value); # printf("dapat tigil na."); # return temp; # } # # … | |
i am making a binary search tree, but when i use some functions and return their values, i get an error when i have to print those values. i don't understand why. please help. [CODE] #include<stdio.h> #include<stdlib.h> #define N 10 typedef struct nodetag{ int value; struct nodetag *left; struct nodetag … | |
[CODE=c] #include<stdio.h> void astrcat(char s[], char t[]); //to concatenate two string main() { int i=0,p=0,q=0,c; char s[100],t[100]; while((c=getchar())!='\n') s[p++]=c; while((c=getchar())!='\n') t[q++]=c; astrcat(s,t); while(s[i]!='\0') printf("%c",s[i++]); return 0; } void astrcat(char s[],char t[]) { int i, j; i = j = 0; while (s[i] != '\0') /* find end of s */ … | |
Hi, I need some assistance in how to count the number of lines in a given file. It is a small part of a homework assignment I have and I am having problems figuring it out. I am to assume that in each line there will be a maximum number … | |
[CODE] #define fst 1 int main() { #if( fst ==1 ) printf("FST\n"); #else printf("Dummy FST\n"); return 0; }[/CODE] if i replace the statement in line 4 with [ICODE] #if fst [/ICODE] also the code is working. can any one tell me what is the correct way , advantages and disadvantages. | |
I am new to C programs. I have tried to write the code for game of life. I started with just the first part. But its still not done. There are some errors. could you please point out where I am wrong? [code] #include<stdio.h> #include<stdio.h> #define NUM_ROWS 100 #define NUM_COLS … | |
Hello everyone I have been working on generic C data structure (Doubly Linked List) and I have a question: ------ List.c ----- [code] struct node { void *data; struct node *next; struct node *prev; }; struct list { unsigned int length; struct node *head; struct node *tail; }; typedef struct … | |
| I am attempting to get an input that can have varied types, float, int and a string are the three, I'm using sscanf to analyze the input from a buffer but for some reason I am getting memory access violations and I don't really know why. Main program: [ICODE] #include … |
I have binary search - this one , but i need to change it like this , that it will search : for example we have array {1,10,11,12,15,16,22,22,22,22,30,40} I want to find 22 but not randomly - or it will be first 22(that goes after 16) or last 22 (that … | |
I am getting a seg fault when I try to run this code. The compiler is also giving me odd warnings about how an integer constant is too long for "long" type. Here is the code: Declarations [CODE] #include<stdio.h> #include<string.h> #include<stdlib.h> void printstates(){ printf("Enter the number for the corresponding state:\n\ … |
The End.