15,551 Topics

Member Avatar for
Member Avatar for madmhan84

Hope someone could help me on this one, thanks in advanced! My objective is to repeat an input until the user hit/press the letter 'N' But the problem is when it comes to the part of answering the question: "Add Another Number? [Y/N]" the program stops! Here's my faulty code: …

Member Avatar for madmhan84
0
159
Member Avatar for Gaiety

Hi, I just started unix programming . below are the two files i am using for reading/ writing from/to a named pipe called RNP. read.c is run on one terminal and write.c is run on other terminal. write.c is accepting the input , but read.c is not reading the input …

Member Avatar for Gaiety
0
145
Member Avatar for brcondor

Hi all, I need some help. How can i load a bmp file and trasform it into a matrix of floating point elements? I have read about the internal structure of a bmp file: should I create a struct with that specification? And then just using fread and create the …

Member Avatar for Ancient Dragon
0
45
Member Avatar for terence193

I am trying to store data from two variables in a text file .. and then try to get the data back and output it on screen but somehow the following program is not working as supposed to be. I first enter data in the two variables n1 and n2 …

Member Avatar for zeroliken
0
91
Member Avatar for mnNewbie

I need to basically rewrite grep command: method is suppose to take an exact string and an exact filename as the 2 arguments grep<string><filename> then it has to search through the file for the string and print out the "line" and the "line number" the string is in. example #grep …

Member Avatar for WaltP
0
290
Member Avatar for tejaspandey

[CODE] #include <stdio.h> #include <stdlib.h> int main() { FILE *fp; char ch; fp=fopen("exp.txt","w"); while( (ch=getchar()) !=EOF) { putc(ch,fp); } fclose(fp); return 0; } [/CODE] I am using gcc compiler in linux mint This code is not working only exp.txt is created which is empty.

Member Avatar for Gaiety
0
145
Member Avatar for shwee

[code] main() { if() { if() { if() { something () /* something so that the program executes the last line means last printf without using goto ststement */ } } } printf("hello"); } [/code]

Member Avatar for Narue
0
162
Member Avatar for noorf

Hi everyone :) This is one of my first programs using C, so I am facing some issues. our professer asked us to develop a TCP socket (client/server) where the client sends lets say an ID,Name or Major and the server searches into a txt file and returns the line(s) …

Member Avatar for Trentacle
0
260
Member Avatar for Sushi

I'm trying to write a function that gets an array, it's size and the number I'm looking for. The function should be recursive. That's what I've written, it doesn't work. I don' understand why. Suggestions are welcome. [code=c] #include <stdio.h> int binary (int *a, int n, int num) { int …

Member Avatar for WaltP
0
277
Member Avatar for terence193

Well , I am trying to create a bees game as part of my assignment .. Now in this simple game I should use a text file .. and the text file is to create different game stats in different lines.. eg.. "10 (number of bees) 0 (number ofinfected bees) …

Member Avatar for Trentacle
0
114
Member Avatar for harrismahadevan

hi! I'm MCA 1year student. I want tree traversal program for given Alphabets not numbers.. Can anyone response my thread.. Thank U..

Member Avatar for Narue
0
37
Member Avatar for roona

Hay every one Hay everyone I need help I have project in subject programming languages about make one idea on two languages c and java . I have made it in java and c++ but I couldn't in c This is the code in C++ [CODE]// Link.cpp : Defines the …

Member Avatar for VernonDozier
0
238
Member Avatar for manaila

I have the following URL which I want use to access the content in a remote Apache Tomcat server from a C-based client: [CODE]char url[] = "POST /myDir HTTP/1.1\x0D\x0AContent-Type: text/xml\x0D\x0AContent-Length:60\x0D\x0A\x0D\x0A<root><mygreeting>Hello, World!</mygreeting></root>\r\n";[/CODE] However, I get the response [B]"HTTP/1.1 505 HTTP Version Not Supported"[/B]. I have googled and found that this may …

Member Avatar for manaila
0
161
Member Avatar for newbie14

Dear All, I can insert data into mysql db already via my C codes. The only problem now I need insert the time in this format "2011-12-11 09:01:02". How can I format this in my C codes? Thank you.

Member Avatar for newbie14
0
79
Member Avatar for adohertyd

I am writing a spellchecker program and have some issues. First thing is that I need to make better use of the memory. My code iterates through a large dictionary file repeatedly. I know its better to read this into memory first then iterate through the block but I really …

Member Avatar for VernonDozier
0
210
Member Avatar for placebo1

i want to read parameters from a file. but the program reads all parameters as if they are zero.any help? here is the code [CODE] typedef unsigned long int WORD; unsigned long int parameters[2]; WORD pt1[2]; void readConfig() { char a[3]; FILE *p; p = fopen("config.data", "r"); if (p) //we …

Member Avatar for placebo1
0
183
Member Avatar for roona

Hay everyone I need help I have project in subject programming languages about make one idea on two languages c and java . I have made it in java but I couldn't in c this is the code in java [CODE] Class Link // Link.java // to run this program: …

Member Avatar for zeroliken
0
217
Member Avatar for CReza

I have to write persian (farsi) characters to a text file, but after writin when I open the file ,it's contents are unreadeable in persian and ther is some special characters pleaseeeeeeeeeeeeeeeeeeeeeeee help :-(

Member Avatar for v3ga
0
165
Member Avatar for mangatmodi

Something is not going right in the following code. I am taking an array of strings from user and printing at the same time. Array can have [B]noe[/B] no. of strings, as noe is entered by user. [CODE]#include <stdio.h> int main(){ char **p; int noe=0,i=0,j=0; scanf("%d", &noe); p=malloc( noe * …

Member Avatar for v3ga
0
152
Member Avatar for peter20

Hi all, I have to check and give grades to some projects written in C. Do you know a free program which detects source code plagiarism ? I found CodeSuite but it asks me for key. Thanks in advance

Member Avatar for L7Sqr
0
297
Member Avatar for iamcreasy

What is the most efficient way to take input of a character array or string of 25 ASCII characters using scanf? They are not formatted, just a sequence of character. i.e. ABCDEFGHIJKLMNOPQRSTUVWXY One more point is that, after input I have to find a sequence of character within this string, …

Member Avatar for Narue
0
429
Member Avatar for newbiecplusplus

Hi, i'm really stuck with this linked list and i feel tottaly out of my depth. Hopefully i can get it a bit clearer! what im trying to do is a print simulation with three priorities and im trying to make the linked list to act like the queue so …

Member Avatar for bbman
0
134
Member Avatar for evanescence

Hi, there. I've been trying to get my program to work for several hours now and I just can't fgure out what's wrong with my code. It's about passing a variable between processess using pipes. Each process increments it M times. The program works perfectly when I use shared memory, …

Member Avatar for evanescence
0
139
Member Avatar for kikic

I need a problem, i use PIC simulator to import2 numbers by serial port. First I send byte, 5 for example, then send sent 2 and in the third step I sent char for example *, and the result is 5*2=10. Everything is fine till I send larger number more …

Member Avatar for Begginnerdev
0
193
Member Avatar for bonett09

Hi guys, I have a problem with this question, where the amount is constantly $0 and at the end if the user enters Y/N it just closes without saying "Transaction Completed/Cancelled". Any tips on how to fix it? Thanks [CODE]#include<stdio.h> #include <iostream> #include<math.h> int main() { int numofbees; float price …

Member Avatar for WaltP
0
134
Member Avatar for gman1991

[CODE]int main(void) { int operations, i, operands; char *string_dig1, *string_dig2; // OPEN THE FILE FILE *ifp; ifp = fopen("bigint.txt", "r"); fscanf (ifp, "%d", &operations); printf("%d\n", operations); // MAKE MEMORY TO READ THE STRING DIGITS INTO THE ARRAY string_dig1 = (char *)malloc(sizeof(char)); string_dig2 = (char *)malloc(sizeof(char)); for(i = 0; i <= …

Member Avatar for gman1991
0
236
Member Avatar for ben25x

Hello, I've been having a lot of trouble with a variable type called "float64". I'm trying to create a do{}while loop to make the number count up each time. data is also defined as an array. [CODE]float64 data[1]; int i; do{ for(i=0;i<1;i++) { data[i]=data[i]+.01; if(data[i]>9.99) data[i]=-9.99; } }while('0'=='0');[/CODE] Any guidance …

Member Avatar for ben25x
0
126
Member Avatar for naz1234

Hello there,ihave given the assigment to make the c program to print the asterisks to represent the grades.. My question is , why the asteriks does not appear ? I think i got problem at the looping for asterisk.. actually my output should be like this : the graph such …

Member Avatar for naz1234
0
170
Member Avatar for The 42nd

Hello. The title pretty much says it all. I would like to know if and how you can print a number (type is double) with the same amount of decimal spaces as the one you entered. If I enter 12.34 I would like the output to be 12.34 and not …

Member Avatar for Narue
0
240
Member Avatar for denislaf

Hi everyone! I have a task that needs to be made in C in Linux. I use Kubuntu. This is the task: Process (coordinator) creates 10 working process (pool of processes). The working processes are waiting to be awakened by the coordinator, perform a job and wait again. The coordinator …

Member Avatar for denislaf
0
192

The End.