15,551 Topics

Member Avatar for
Member Avatar for tehloki

Hey, I have here a piece of code that works in parts but does not work together. If I test all three parts at once, I get a segmentation fault immediately before the program is supposed to test for a (null) value in the string array. However, if I comment …

Member Avatar for Ancient Dragon
0
972
Member Avatar for flageolet

this the full code, which works like a charm, except for the error when i close the program. (a normal 'send report' / 'do not send report' error). I've narrowed it down to one line (a variabele being read from a file -> posted in red), but can't seem to …

Member Avatar for Salem
0
151
Member Avatar for Dqube

I've to do a shool project where i have to write a messager in C with a friend of mine. We have to split our programm in to pieces <- Teacher said that. I do the GUI and he sends and revieves the XML-Formated messages. Now here is the Problem: …

Member Avatar for Infarction
0
70
Member Avatar for flageolet

The code below works for the first question (first half of the code), the program then proceeds to the second questin, but it never stops to await the answer. I can't seem to figure out what I'm doing wrong? Thx [code] #include <stdio.h> using namespace std; char answer; int main(int …

Member Avatar for flageolet
0
167
Member Avatar for donaldunca

I have a question: I create a file named "number.inp". This file has a row of numbers: 5 4 4 3 3 3 2 note: 5 is the first number, haven't any space or char in front of 5 [CODE] #include<stdio.h> #include<conio.h> #include<stdlib.h> main() {clrscr(); int ch,v[10],count=0,i=0,j=1,n=0,a[10]; FILE *f; f=fopen("number.inp","r"); …

Member Avatar for donaldunca
0
98
Member Avatar for khoramdin

Hello, I need to create an Window Application which monitors the DVD-Player / DVD-ROM. I need my application to be able see if someone gets the DVD device running and also can see if they chose to Play - Stop - Pause - FF and the rest of functions available …

Member Avatar for John A
0
91
Member Avatar for jd_1604

Hello all. I have been trying to run a program on my VC8 compiler which incorporates the Allegro enviroment. It enables users to move a small robot.bmp image around the screen by using the arrow keys. Problem is I get my main window up and first animation frame displayed, but …

Member Avatar for Ancient Dragon
0
233
Member Avatar for bosko

Hi all! I have some biginner question: I've started to learn C from the Kernighan&Ritchie book, using Pelles C compiler. Why this code (from the book) dont work: [code=c] #include <stdio.h> /* count characters in input; 1st version */ main() { long nc; nc = 0; while (getchar() != EOF) …

Member Avatar for ~s.o.s~
0
121
Member Avatar for cusado

im writing a program that opens a file, reads until it arrives at a colon, then jumps over the colon and reads the number after the colon the txt file contains pi:3.14159 feetPerMile:5280 0FinDegreesC:-17.8 Count these words:3 Space before number: 2.0 What about comments: 6.024e23 so i want to skip …

Member Avatar for Lerner
0
122
Member Avatar for Jishnu

I have seen that writing anything after the completion of any pre-processor compiler directive does not affect either compilation or running of the program. i.e. #include<conio.h> 123as!#@ #define M 100 *&^asdf is perfectly valid. How can such athing happen ?

Member Avatar for Ancient Dragon
0
131
Member Avatar for flageolet
Member Avatar for mailsteam

[CODE]#include<stdio.h> void myalloc(int **b) { *b=malloc(sizeof(int)); **b=10; printf("**b=%d\n",**b); } main() { int *a; myalloc(&a);// is this convention is correct? printf("*a=%d\n",*a); }[/CODE] i have not initialised *a. can i pass the &a(address of a pointer) without initialising it. Please look at my small program and help me out. is it a …

Member Avatar for mailsteam
0
77
Member Avatar for HS20064972

I need someone help me and share a programe 2 me.Help me... ok... Peace..:sad: thanks for your idea...

Member Avatar for ~s.o.s~
0
138
Member Avatar for amishosh

Hi! Here's my code: [code] for(i=0;i<N;i++) { for(j=0;j<M;j++) printf("%4.2f ",mat[i][j]); printf("\n"); } [/code] I want it to look like this: 68.85 52.25 32.00 -100.00 -632.25 -26.56 Instead I get: 68.85 52.25 32.00 -100.00 -632.25 -2.56 For life of me I can't remember how to get th alignment right. Anyone? Thanks

Member Avatar for Ravalon
0
82
Member Avatar for whitemoss

Hi All, Im currently try to write a code to read the data from mysql tables and then write the contents into a text file. Below is my code. I dunt know what's wrong with this code because in the text file created, there is no data from database written. …

Member Avatar for Ancient Dragon
0
247
Member Avatar for amishosh

I want to create the effect of a moving square. I would have to clear the previous position of the square and then draw a new one, right? And if that's tru how do I clear just that portion of the screen leaving the rest of my screen in tact? …

Member Avatar for John A
0
87
Member Avatar for caltiger

Hi, i would like to know if there r any native functions in C with which i can detect a keypress ( independent of the platform ). The same ofr mouse functions as well.. Any function to detect a mouse click? If not, how to detect a key press... ? …

Member Avatar for apurv
0
654
Member Avatar for gauravji

Hi , I want to create a dll using the cpp file. I have followed some steps which I got from the some forums and tried to create a dll and it throws the following errors. [code] ********************************************************** islicenseviewed.cpp(19) : error C2146: syntax error : missing ';' before identifier 'CALLBACK' …

Member Avatar for Ancient Dragon
0
234
Member Avatar for wayani

Hi. My name's Brianne and I just now started this semester taking Programming, Logic and Design. I have a homework problem, and what blows is this class is online, so I have to read the book, and write 100 times to get something down ... and I just don't get …

Member Avatar for WaltP
0
256
Member Avatar for amishosh

Is there an output function in C that keeps the cursor ON the last char printed and NOT after it? (Aside from using gotoxy(wherex()-1,y)) Thanks Ami

Member Avatar for amishosh
0
78
Member Avatar for Jishnu

Does anybody here know how can i manage global data in multifile C programs ? Plz do reply.

Member Avatar for jwenting
0
255
Member Avatar for Manojsah

Respected Viewers, I have to implement Network File System (NFS) . Could any of You Guide how to do that. I have to create my own shell having server as well as client performing some function like mkdir(), open(), create(), read().... etc regards

Member Avatar for Mark C
0
171
Member Avatar for VIDHYAPREM

hai everybody, know only i start learning c program,while compiling any program i have the error "[B]stdio.h was not included"[/B] even any header file it may math.h,conio.hstdlib.h etc,we include in our program it show this error [B]"you header file is not included"[/B] [B]how will i rectify the error.[/B] [B]Thanks in …

Member Avatar for ~s.o.s~
0
91
Member Avatar for dukiduki

Hmm,first sorry for some grammar mistakes... I have a big problem with graphics in C... For 2 days i'm looking on internet and nothing...I saw some theards and posts but none of the lib didn't work...(It was forums on my language ) I'm working in VS 6.0 I saw here …

Member Avatar for dwks
0
214
Member Avatar for mehakkapur

If you have to count numbers of 1 in a 32 bit word. Other than checking every other bit or dividing the bits is 4 parts and then using lookup table. What will be some other most efficent way ?

Member Avatar for Ravalon
0
94
Member Avatar for degamer106

i've been trying to use fscanf to parse parts of a line from a file. The format of each line is like the following: Connecticut,1788,Hartford,29 I've been trying to use this: [CODE]fscanf( fpIn, "%[^,], %d% [^,], %d", name, &year, cap, &popRank )[/CODE] To extract the state, year, capital, and population …

Member Avatar for Salem
0
76
Member Avatar for hariza

Hi Guys, I wonder if someone can help me out with this. I'm running the same C code in diffferent platforms (windows/unix) but getting different result. For instance the code is: [code=cplusplus] fgets(line,LINE_BUF,fp); while (!feof(fp)) { Len=strlen(line) - 1; if ( (newNode=malloc(sizeof(ListNode))) == NULL) { fprintf(stderr,"\nListInsert: Memory Allocation failed! Aborting.\n"); …

Member Avatar for Dave Sinkula
0
148
Member Avatar for fsemilla

/*****in the book ive read, they gave me a code which will be placed in the .rss file as shown below...*****/ RESOURCE LISTBOX r_demo_listbox { flags = EAknListBoxSelectionList; array_id = r_demo_listbox_items; } RESOURCE ARRAY r_demo_listbox_items { items = { LBUF { txt = "Item1"; }, LBUF { txt = "Item2"; …

Member Avatar for fsemilla
0
116
Member Avatar for rajbasu
Member Avatar for unclepauly

i am using CreateThread to, unsurprisingly, start a thread :p is it possible to return a value? i need to return either true or false at least. ideally i need to return 0, 1 or 2 to indicate the success of certain things that go on inside the thread. I …

0
74

The End.