Searching text file  

Hey guys, I am having some trouble reading a file for a specific string then getting the next two lines of numbers after it. The file would look something like this: Bill12345 6789064528 09342Jeff34872 5890817830 47674Moose12465 0685448736... Continue Reading
Views : 86
Wednesday 19th of September 2012

How to see all ASCII characters on Turbo C++ compiler output window  

I have the following code for which I need to no explanation,the doubt is about the seeing the output of all the 256 characters together or page up - page down manner on output window of Turbo C++ compiler.Here is the code to print the ASCII character.By the way I was told by my teacher... Continue Reading
Views : 26
Wednesday 19th of September 2012

Help me please  

I wrote this program. I want to divvy up the sentences to the words and store the words in an pointer array. But I got runtime error. Please help me to solve this problem. Thank u... Code: Continue Reading
Views : 80
Wednesday 19th of September 2012

sigaction structure initialisation  

To initialise structures, instead of using memset() I've got used to doing e.g. Code: struct sockaddr_in serv = {0}; I'm learning about the sigaction() function and ... Continue Reading
Views : 130
Wednesday 19th of September 2012

Explain this program please  

Code: #includeint main(void){ int i=4,j=-1,k=0,w,x,y,z; w=i||j||k; x=i&&j&& k; y=i||j&&k; z=i&&j||k; printf("\w=%d x=%d y=%d z=%d",w,x,y,z);} I was implementing this code in Pelles C.... Continue Reading
Views : 107
Wednesday 19th of September 2012

How to remove Segmentation Fault  

The following code can detect a (single) macro name (stored in str1) from a file and store its definition (stored in str2) and then reads the file again to write into a new file, replacing all occurrences of the macro name with its definition. The code when executed gives segmentation fault, please... Continue Reading
Views : 190
Wednesday 19th of September 2012

New to C Programming, need help in a program  

Hi to all, I'm 17 and from India, studying for the degree of Bachelor in Computer Application. C is one of the subjects. I need help in a program: This is username and password program. Continue Reading
Views : 94
Wednesday 19th of September 2012

word occurence counter 'forgetting' about already saved word  

The snippets below are from my program that gets words, then prints them with the number of occurences.It works almost fine - it "forgots" that that entry has been saved before and does NOT increment counter associated with that. So I get eg. we - 1 we - 1 we - 1 instead of we - 3. Continue Reading
Views : 138
Wednesday 19th of September 2012

Brand New to C; First Program and a Couple of Questions  

Hey guys! I'm brand new to C and I'm having a hell of a hard time so far. I'm currently writing one of my first programs for my class and I'm completely suck. We're supposed to write a cash back program where a user enters a dollar amount up to $100 and they get their change back in twenties, tens,... Continue Reading
Views : 84
Wednesday 19th of September 2012

Raising an Integer to a power  

Hello, I'm currently writing a program that is supposed to raise an integer to a power. However, the output keeps printing as going to infinity rather than the actual number when using the test results. I tried changing the double type to a long double, but it still is not large enough. Earlier when... Continue Reading
Views : 168
Wednesday 19th of September 2012

Trouble with cos and sin function from math.h  

When I compile my code, it can't find the cos or sin functions. Here are my #include statements. Code: #include #include #include #include #include... Continue Reading
Views : 153
Wednesday 19th of September 2012

Problem in converting.  

Hi guys. I'm a new member in this forum and I have basic in C, I think. I have a bit problem, to convert from decimal to binary. I only have a bit of idea how it going to work. All I know, user will input a number, for example 255 .the operation will use % until the final... Continue Reading
Views : 246
Wednesday 19th of September 2012

Help!!! (Malloc for beginners )  

hello everyone!i have an assigment and i dont understand how to write the malloc section. in my input i get names and team names.there's a struc of "info" that points to the struct that contains the name data. i need to use malloc to save all the data and then reuse... Continue Reading
Views : 181
Wednesday 19th of September 2012

How to rebuild a library  

Hi again! I would like to build upon one of my previous threads ( Continue Reading
Views : 140
Wednesday 19th of September 2012

C guru help needed URGENT  

I have a program , custom , thats eating cpu cycles by running getttimeofdayi searched around and found a way to load my own library with empty gettimeofday ()it seemed to help as the process is accessing my versionbut now the program hangs and strace shows Continue Reading
Views : 107
Wednesday 19th of September 2012

C Draft Standards  

For those who are interested, here is a current draft of the C standard, containing C99:A working paper containing the Current ISO C standard incl TC1 and TC2 is available (pdf) Continue Reading
Views : 99
Wednesday 19th of September 2012

A development process  

Here's a development process I like to use. I'll use a program that counts letters, digits, punctuation, and whitespace in a file as an example. This was an answer to a question, but I was asked to turn it into a thread for reference. This time I'll use color keys too. Blue... Continue Reading
Views : 147
Wednesday 19th of September 2012

C Book Recommendations  

Use this thread to recommend books on C. Please include a description of what this is book is good for, and not good for, etc... UPDATE By webmaster--below is a listing of the books most commonly recommended in this thread: Continue Reading
Views : 92
Wednesday 19th of September 2012