15,551 Topics
| |
I am trying to get the main to read in a number, and use that number to do a mod calculation. However my best efforts are giving me garbage values. I am sure I am not using the pointer correctly, yet my efforts have gone unrewarded. How can I get … | |
Ive been trying to create a number guessing program were the program guesses your number instead of the user guessing the programs number heres what i have so far: [code=c] #include <stdio.h> int main(void) { int guess = 50; printf("Pick an integer from 1 to 100. I will try to … | |
Hi I need some ideas to force MQGET call fail on receiving interupt signal in AIX O/S. Thanks in Advance | |
Hello, I am trying to figure out how to use memory blocks and create a block of data that contains different data types within it. In my particular example I want a pointer to a memory block that contains a struct followed by an array of floats. This is what … | |
can anyone in here help me with my programming project. Your C program must be invoked exactly as follows: shell [batchFile] The command line arguments to your shell are to be interpreted as follows. batchFile: an optional argument (often indicated by square brackets as above). If present, your shell will … | |
After finishing my lesson on loops and array initialization i managed to sit down for a good 15 min. and right a calculator now the code is perfectly clean but when i run it i doesn't do what i programmed it to do..here is the code [code] //*********************** //* //* … | |
I have a codein which i want to do the following: main(int argc, char *argv[]) { fp1=fopen(argv[1], "w") function(para1, para2, ??) } function(para1, para2, ??) { fp2= fopen(argv[2], "r") } So eesentially i want to pass a few parameters and the pointer to the function. I dont know how to … | |
I am trying to create a simple C program that uses HandBrake (video converter). The only way to run this program is to have one of the (in my opinion) crappy GUIs or to type out all of the arguments in the command line. My program is simpler than the … | |
I just started teaching myself c with a book called practical c programming, and i can't figure out one of the exercises. I'm supposed to write a function that scans a character array for the character - and replace it with _. I tried doing it, but i don't think … | |
O.k i searched the site but didn't find anything related to my problem. all ive done is made a simple calculator using the "else if" command. I'll post my coding and compiler errors below. [code] #include <stdio.h> main() { int valid =0; char operator; float number1,number2,sum; printf("calculator\n"); printf("number\t operator\t number"); … | |
I need to know can i make a for loop to place fopen function to open a set of files like i want file1.in file2.in file3.in .......filen.in so on depending on n value i give for num of files to be created ... as i want to place set of … | |
I am trying to to Develop a Dictionary in C and it is completed almost . I want to create a List box (Auto Complete) Function . I created the List box as same as the image . And loaded the array into it . Initially the list is A-Z … | |
HI I would like to pass new argument to cureently running process with out interuption in unix using c code can any one Idea on this Please suggest Thanks in Advance Madan | |
hello all...i need help with the code below.. [code] #include <stdio.h> #include <windows.h> main() { MessageBox(0,"hello world","hello world",0); fflush(stdin); getchar(); } [/code] now i know it is perfectly clean code...but the problem is if i put 2 messagebox functions linke this [code] #include <stdio.h> #include <windows.h> main() { MessageBox(0,"hello world","hello … | |
i am trying to write a program that finds all twin primes between 1 and 100. any suggestions? [CODE]#include <stdio.h> #include "genlib.h" #include "simpio.h" int main() { int n1, n2, y, x; printf("This program list all the twin primes.\n"); for (y = 3; y <= 98; y += 2) { … | |
I'm getting an error msg as Type mismatch in redeclaration of 'putw' for the following code... Can anyone suggest the reason for this??? [code]#include<stdio.h> union pw{ short int i; char ch[2]; }; int putw(short int num, FILE *fp); int main() { FILE *fp; fp=fopen("test.tmp","wb+"); putw(1000,fp); fclose(fp); return 0; } int … | |
for my new job, i have to learn coding for the chips. i know c, but i don't have any idea about how to coding for chip. anyone can give me some hit where is good place to get start. | |
I NEED HELP WITH THIS PROBLEM!!!! ANYONE!!!! /*3. Write the function: double max_norm(double *v, int n) to compute the maximum norm of vector v[] with n elements. The max norm of a vector is computed by taking the maximum absolute value of its elements. In prob3() compute x1[]=a[][]*x0[], call max_norm() … | |
how to cast a floating point to display an fraction form?? is there a way?? | |
I'm almost finished with this but got stuck in trapping it when 1)there is a winner 2) a player attempts to enter a position that has been previously filled [CODE]#include<stdio.h> #include<conio.h> display(); game(int turn, int board[3][3]); output(int board[3][3]); main() {int turn=1, board[3][3]={0}; clrscr(); display(); while(turn <= 9) {game(turn, board); turn++; … | |
Hey, This a bit of a lengthy problem to explain, please bear with me. My goal: Read in a data file (written in ASCII) and convert it to a smaller format (such as binary) The Problem: I start off with a proprietary format called Heim RawData. I currently don't have … | |
hello everyone. i m monjuri. i want to find out the execution time of a C program. it works fine. but i want the time in milisecond or microsecond. Can anybody help me??? here is my code: /*insertion code*/ #include <stdio.h> #include <time.h> #define maxsize 10 int A[maxsize]; int value,j,i; … | |
Hey guys, I'm parsing this WaveFront .obj file, still (for those that have read the previous post), but it has some really weird error in it that I haven't seen in a program before. The parsing algorithm starts out like this: [code]Open the file in textmode. Get filesize Allocate buffer … | |
I am trying to create a program that will count and display the number of vowels, consonants, spaces and full-stops within a 50 character limit. There is one error that the compiler keeps bringing up and when i try to fix it by changing the text it creates more errors … | |
I cant find anything wrong with my program, any suggestions? [CODE]#include <stdio.h> #include "simpio.h" #include "strlib.h" #include "random.h" int main() { int s, r, h, w, l, t, shape; string box; string cube; string cylinder; printf("Please enter the shape; "); shape = GetLine(); switch(shape) { case 1:cube();break; case 2:box();break; case … | |
I am Mritunjay from India.I want to study C programming language.As I want to be a PHP developer.I have heard that one should know C before knowing PHP. How can I get daily classes for C? What is the initial step for it?I want to start with with abc of … | |
Hi guys! I have started learning geometry and wrote a code to calculate the distance between a line(or a segment) and a point. Here is my code: [code] #include<stdio.h> #include<math.h> #include<stdlib.h> int dot_pdt(int a[],int b[],int c[]) { int ab[2],bc[2]; ab[0]=b[0]-a[0]; ab[1]=b[1]-a[1]; bc[0]=c[0]-b[0]; bc[1]=c[1]-b[1]; // printf("%d\n",(ab[0]*bc[0]+ab[1]*bc[1])); return (ab[0]*bc[0]+ab[1]*bc[1]); } int cross_pdt(int … | |
my problem is quiet similar, i used atof here my data and code: "square10.dat" 0.01 1:0.1 0.04 1:0.2 0.09 1:0.3 0.16 1:0.4 0.25 1:0.5 0.36 1:0.6 0.49 1:0.7 0.64 1:0.8 0.81 1:0.9 1.00 1:1.0 THE CODE: [code=c] #include <stdio.h> int main() { char c[10]; /* declare a char array */ … | |
Hello, this type of structures are confusing. I hav been working with C for a while but this subtlety is yet unknown. I have come accross such a structure in a program where suposedly it will be used for FIFO management: [CODE=C] typedef struct FIFO_TAG{ struct FIFO_TAG *NextElement; }FIFO; [/CODE] … |
The End.