15,551 Topics

Member Avatar for
Member Avatar for deeer

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 …

Member Avatar for deeer
0
750
Member Avatar for serious01
Member Avatar for jephthah
0
96
Member Avatar for jsp133100

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.

Member Avatar for Software guy
0
109
Member Avatar for lionaneesh

[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)) != …

Member Avatar for nezachem
0
155
Member Avatar for AngusFloydKAOS

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?

Member Avatar for nezachem
0
108
Member Avatar for lionaneesh

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...

Member Avatar for jephthah
0
117
Member Avatar for lyn.vita

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 …

Member Avatar for Adak
0
138
Member Avatar for jacksparao
Member Avatar for lionaneesh

[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).

Member Avatar for aman rathi
-1
210
Member Avatar for jasneg16

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

Member Avatar for WaltP
0
143
Member Avatar for prade

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.......

Member Avatar for Ancient Dragon
0
88
Member Avatar for spursfan2110

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) …

Member Avatar for spursfan2110
0
2K
Member Avatar for BestJewSinceJC

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 …

Member Avatar for BestJewSinceJC
0
93
Member Avatar for serious01

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().

Member Avatar for serious01
1
131
Member Avatar for meisterluv

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 …

Member Avatar for gerard4143
0
238
Member Avatar for johndoe444

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 …

Member Avatar for johndoe444
0
114
Member Avatar for ryanleslie

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 …

Member Avatar for jonsca
0
95
Member Avatar for OzY360

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 …

Member Avatar for OzY360
0
134
Member Avatar for illIAm

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 …

Member Avatar for Xufyan
0
15K
Member Avatar for lionaneesh

The books i have already read :- 1. C ANSII Edition ( Cant understand their language ) 2. C tutor 3. Pointers and memory ( Stanford )

Member Avatar for Narue
-1
246
Member Avatar for spursfan2110

Hey, just curious. Is atof() a C++ only function or will it work in standard C?

Member Avatar for Narue
0
121
Member Avatar for Iam3R

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

Member Avatar for Narue
0
259
Member Avatar for patsfan

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 …

Member Avatar for abhimanipal
0
115
Member Avatar for ndovu

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 …

Member Avatar for Adak
0
133
Member Avatar for jessicacarl
Member Avatar for VernonDozier

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[] = …

Member Avatar for VernonDozier
0
7K
Member Avatar for formulajake88

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 …

Member Avatar for jephthah
0
501
Member Avatar for Yggdrasil

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 …

Member Avatar for jephthah
0
168
Member Avatar for spursfan2110

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, …

Member Avatar for spursfan2110
0
110
Member Avatar for priyankapandey

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; …

Member Avatar for Narue
0
1K

The End.