15,552 Topics
| |
Hello, I'm just a beginner (student). Now still undergo C programming class to upgrade my knowledge in C. I was asked to complete a simple program to get the output of C program in the text file as shown below. This program is to help user to consider a range … | |
Hey guys im having trouble completing this C program. Its suppose to ask the user to enter a file to read from, read the file, count how many times each word appears and print the results in a different file(also user input) arranged from high occurrence. Heres what i have … | |
Hi, I can find the largest number. But I can not find the second largest number. I dont know where to start. | |
I am new to image processing and can u please help me to convert a GIF image into binary using C programming. | |
Hey guys im having trouble completing this C program. Its suppose to ask the user to enter a file to read from, read the file, count how many times each word appears and print the results in a different file(also user input) arranged from high occurrence. Heres what i have … | |
Hi guys! I just wanna ask on how to access the first character in a string? | |
First let me say, please don't post code back all fixed. If you see where the error is, just tell me where it is and I will look to find it. Thanks, much appreciated! [CODE] /* void processCmdLine(void) Function: parses the command line using gettok(), and constructs an argument list. … | |
Hello everyone, I find C not very flexible this time because I know there is an easy way to assign field values to a struct like this : [CODE]Struct mine = { field1, field2, ... };[/CODE] but in my case "mine" is contained in a bigger struct. So I have … | |
Hello all, I think am having problem getting the add_to_list function below to work. I created it so that it accepts a pointer to a linked list, a pointer to a char array (string) and a number for occurrence of the word. [CODE] #include <stdio.h> #include <stdlib.h> #include <string.h> #include … | |
Hi folks, I am a beginner in Socket Programming. I am trying to do some simple stuff but had a basic query. I would like to implement something like wget in C top of a TCP socket (i.e., without using any HTTP libraries). Just provide a URL (Example-- $wget [url]www.foo.com/bar.pdf[/url]) … | |
I am trying to write my own shell. I am having problems with the user input part. I have made an array (char inputBuff[512]) and I want to read in user input. I am using ffputs() and ffgets() but I want to limit the person to the 512 size, and … | |
Hello, everybody!!! Please, who knows forums to discuss about parallel virtual machine (PVM), could you suggest me. I am writing PVM application, but I don't know well how to read files with PVM. Thank you ! | |
Hi again guys. Well i need to convert char to int my problem is how can i get the exact value of int if for ex: [CODE]char x=2;[/CODE] i need to convert that to integer. | |
Hello, good day. :) I got a problem with "passes occurred". This is the only problem left in my program. My program is about Naive Searching and Binary Searching. There's no problem with my "Naive Searching". The problem is the "Binary Searching". [b]Naive Searching:[/b] This is the result when I … | |
Hi, I have a little problem. I need to write a function that will be given a number (with unknown number of digits) and it will search the number for similar neighboring digits. I must say that I'm not allowed to use arrays (unfortunately). I thought of disassembling the number … | |
Command line arguments in C #include<stdio.h> int main(int argc,char *argv[]) { FILE *fp; char c; if(argc==2) { fp=fopen(argv[1],"w"); while((c=getchar())!=EOF) { putc(c,fp); } fclose(fp); fp=fopen(argv[1],"r"); while((c=getc(fp))!=EOF) { printf("%c",c); } fclose(fp); } return 0; } How to run this program in linux? I have tried these steps: 1. open terminal in linux … | |
I am making a program to compute simple interest. P*R/100 this is what i have done... Please tell me whats wrong [CODE]int main() { int p,n,count; float r,si; count=1; while(count<=3) { printf("\n enter values of p,n,andr"); scanf("%d %d %f",&p, &n, &r); si=(float)p * (float)n * r / 100; printf("simple interest … | |
Hi, I thought I have mastered fighting segmentation fault thanks to the assistance of you guys. But still in this days I am getting seg fault. And there is no clue at all. I am writing a suffix tree using a trie. Here is the trace of segmentation fault: [CODE]aba … | |
I have just started with MinGW. I tried to compile a simple C program ie., Hello World but came up with the following error error:no include path in which to search for stdio.h can anyone help me out with this problem.... | |
Can anyone help me with my code?! I need to do a programm binary to decimal converter without using library, just stdio.h my code works wrong [CODE] void bin2dec(){ long int n; int s=1,j,p=1,i=0,x; int digit=1; printf("Input a binary number: "); scanf("%ld",&n); while(digit==1) { x=n%10; s=s+pow(2,i); i=i+1; n=n/10; if(n==0) digit=0; … | |
Hey guys. In C++, if I wanted to read strings into an array I would do this: [code]std::string theWord = ""; for ( int i = 0; i <= SIZE; i++ ) { std::getline ( std::cin, stringArray[ i ] ); }[/code] In C, I am having trouble comming up with … | |
I have made a program to test if the string entered is a palindrome or not. Here's the source code: [code=c]#include <stdio.h> #include <ctype.h> #include <string.h> void clrsp(char *); void rev(const char *,char *); int main() { char str1[80],str2[80]; printf("Enter a string: "); fgets(str1,80,stdin); str1[strlen(str1)-1]='\0'; //eliminate newline clrsp(str1); //clear spaces … | |
Developing on an ubuntu system, using code::blocks. Need to read and write to XML config files. there is a DOM library for Gnome, libgdome2. Found a good source for this at [url]http://gdome2.cs.unibo.it/[/url] I am trying to compile the following code, which is more or less straight from the tutorial on … | |
Hi, well what I'm trying to do with this, is to read a text file line by line and pass its data to the struct. the problem is that not only i can't read the strings and put it on the struct fields, I also get a segmentation fault. Could … | |
i have finished writing my program, but teacher want me to write a checkbook balancing program of a user's account. It has to use getline () to read a line, which will contain either the word "withdrawal" or "deposit". After reading each pair of line, the program should compute and … | |
Hello I'm trying to get a random float number between two float numbers using rand() function but I couldn't write it by myself, can you show me how to do it? Thanks... | |
I have the R code for Fisher's exact test, however, I it's a bit too much and I am getting bogged down trying to read through the code. My objective is to calculate the test for a 2x2 table, but I am a bit confused as to where to begin... … | |
struct tnode { int data; struct tnode* left; struct tnode* right; }; struct tnode*talloc(int data) { struct tnode*p=(struct tnode*) malloc(sizeof(struct tnode)) if (p!=NULL) { p->data=data; p->next=NULL; p->right=NULL; } return p; } int main(){} I am getting a [error: 'NULL' undeclared] error, Any help would be greatly appreciated. | |
So this is part of the code in one of my functions, and whenever I enter either yes, no, or something else, no matter what the response the do loop will loop again. I don't think my "if(response == "yes")" is working. Help please? :D [CODE] char response[10]; int answer; … | |
Hello everybody! I am just a beginner in C, so i have some problems with the password input . This is for bank account, it asks user for password input, but it doesn't works properly for three attempts, in order to go to menu: Could you help me please, what … |
The End.