15,551 Topics
| |
hi how do I put words into a specified location of a 2d array using scanf? string movies[100][6]={}; in main i need at least 100 rows and 5 columns i want the user to enter the movie id, name year, type and availability it will be stored in a 2d … | |
hey guys where can i get some homework especially on writing C programs | |
I'm trying to write code for finding the number of same number in array. For example, in [1, 2, 3, 3, 4], the number of same number is 2. In [1, 2, 1, 3, 1], the number of same number is 3. How can I implement this? Please, help me. | |
[CODE]#include<stdio.h> #include<string.h> #define count 2000000 void add(char word[],char meaning[]) { FILE *fp; fp = fopen("words.txt","a"); fprintf(fp,"%s = %s\n",word,meaning); } void processing(void) { int i = 0,delay; printf("Processing....\n\n"); for(delay=0;delay<count;delay++) ; printf("\n"); } void getwords(void) { FILE *fp; fp = fopen("words.txt","r"); if(fp!=NULL) { printf("\n/**************************** DICITIONARY **********************************/\n\n\n"); char words; while((words = fgetc(fp)) != … | |
Hey so I'm trying to get one of my c variables to be a bash variable. Is there a way that I can do this? | |
I want to know what is const type in C and what is its uses etc. i dont know anything about this term used in C so please give detailed description... | |
Hi all, I'm trying to write the Hufmann code to encode a given file & give me the compression ratio. but when I run this programme, I'm getting segmentation fault. Can you please help me with correcting it ? [CODE] /*************************/ /*************************/ // HUFMANN.C /*************************/ /*************************/ #include<stdio.h> #include<stdlib.h> #include<input.h> #define … | |
[CODE]#include<stdio.h> #define SQR(x) x * x int main() { printf("%d", 225/SQR(15)); }[/CODE] why this program outputs 225 instead of 1 (according to calculation). | |
im using <stdio.h> and <conio.h> only is there any solution so I can randomize result? I want to make a fortune cookie that randomize the reading. i am not familiar with iostream and stdlib thanks | |
i have done a little project on a turbo c compiler with some graphics in it...my teachers don't want me to use turbo c..can u suggest which other compiler i can use to run my code....... | |
Hi all! So our T.A. gave us a function to use in our programming assignment as follows: [code=php] struct node *delete_from_list(struct node *list, int examnum) { struct node *cur, *prev; for (cur = list, prev = NULL; cur != NULL && cur->examNumber != examnum; prev = cur, cur =cur ->next) … | |
I'm trying to write my own system calls. I have a .c file where I'm putting the system calls. My system calls use a struct, so I have declared a global variable that is an array of my struct. Lets just call it [CODE] //Stuff is the name of the … | |
hey guys, I've just joined this group and i have problem which i believe you can help!!!! I want to know how to make a c program read from an application program like Microsoft excel and them writes the results with its printf(). | |
i'm trying run a cgi script from a c program using execve(). It seems to be able to open and run the cgi file. but instead of actually generating graphical html it generates html code. example: execve("this.cgi", NULL, NULL) will generate: [CODE] /this.cgi /this.cgi <html> . . . the rest … | |
Is this possible to write a variable argument macro like this: [CODE]#include <stdio.h> #include <stdarg.h> #define func(x, ...)\ {\ va_list ap;\ va_start(ap, x);\ int y = va_arg(ap, int);\ printf("y is %d\n",y);\ }\ int main() { int x; func(5, 4); return 0; }[/CODE] I found an interview question which asked how … | |
Error message: "error C2181:1> illegal else without matching if 2>fatal error C1075: end of file found before the left brace '{' at 'c:\documents and settings\tjeo1\my documents\visual studio 2008\projects\new\newc\exercise.cpp(3)' was matched [CODE]#include <stdio.h> int main (void) { int c; printf("letter="); c = getchar ( ); if (('0' <= c && c … | |
| Hi I had a quick question about the libraries in C. Is there anything available like the java api library (java.sun.com) but for C? The closest thing I can think of is the MSDN Library but I'm not sure. A comprehensive guide that describes what the various libraries do would … |
Hi have done the whole program but now am stuck at what initially seemed like a simple thing a repitation loop the program is supposed to ask the user if he/ she wants to continue with adding more data - if no exit and continue with the other stuff. [CODE]char … | |
The books i have already read :- 1. C ANSII Edition ( Cant understand their language ) 2. C tutor 3. Pointers and memory ( Stanford ) | |
Hey, just curious. Is atof() a C++ only function or will it work in standard C? | |
1. Why Nesting of comments is not supported by c. code does not involve much complexity to have that. 2. Why Array partial initialization have zero appended. why it cannot do in normal declaration. 3. continued.... Thanks, 3R | |
He guys, I am trying to figure out what is wrong with this code for level traversal in binary tree in C. I would really appreciate any help or suggestion or changes in my code. [CODE] status level_traverse( tree T, status( *p_func_f ) () ) { tree *node ; queue … | |
I am new in C programming and I would like help to make the following program: A program that reads a file (file name you can get from command line arguments or ask from the user) and produces output that counts the 10 most frequent words in the file and … | |
C video tutorials for beginners [I]<<snip>>[/I] | |
I have some code that works. However, when I try to make it not work (i.e. try to execute a non-existent program), I don't see any indication that it hasn't worked. Here's the code snippet. [code=C] pid_t pid; // char *const paramList[] = {"/usr/threshold/bin/preconfig.sh", options[indexSelected].optionName, NULL}; const char* paramList[] = … | |
Hello everyone! I'm a beginner in C programming, and am writing code that is supposed to read in all the data from a formatted file, parse it into useful values, and then manipulate these values. However, I'm stuck on the the parsing part. I'm relying heavily on pointers, which I'm … | |
During a university project, I had to print some int arrays to the screen, and I wanted to do it with printf. So I decided to include a function that converts an integer array into a string type, and passes the string out to the calling function. But the function … | |
This isn't entirely a programming problem, but it may be at its base, which is why I'm bringing it to you guys. For my assignment, I have download a .txt file from my prof's webpage, and then have my program open it. The file, when opened in a web browser, … | |
can anyone explain how can a function return a double pointer with which a 2 dimensional array can be traversed, this function takes the number of rows and columns as arguments: like: void ** function(int row, int col) { void **returningPointer= NULL; void*p; for (i = 0; i < row; … |
The End.