15,539 Topics
|
|
I wrote a simple echo program, which reads standard input character-by-character and then prints it to standard output character-by-character. [code] #include <stdio.h> int main() { int c; while ((c = getchar()) != EOF) { putchar(c); } return 0; } [/code] I was expecting it to break out of the while … |
|
I am trying to print out the number of occurences for each alphabetic chracter in a file that our instructor provided us with. The values range from 1 to 999. I'm trying to print out "count[...] : " followed by the character. So far my counts are correct. However, at … |
|
|
I just started this program a few hours ago, and I am running into an error that I do not understand. I tried finding an answer on Google as well. First off, this is the bare bones of a code right now. I have not started any of the sub-functions … |
does someone know a code in c that will send a complete ASCII file in 128 byte packets to another file? So The sender takes the ASCII file as input and sends a 128 byte packet on the data queue |
|
I am writing a small algebra io program for an intro to c class and i am stuck. The idea is to get the user to input (a * b) + (c / d) + (e % f), in exactly the same format as you see it with the exception … |
|
|
Ok, I have read several other questions basically asking the same thing, but I know this code can work instead of using other peoples work. Yes, i'm stubborn. I have written a function to be called from my main program and i keep getting an error that I cannot figure … |
This is an automated system for Bank Management. It uses files to handle the daily transactions, account management and user management. Nice graphical layout and mouse functionality. Manager can add, edit and delete the users and manage the user accounts. Code From: <URL SNIPPED> |
|
I need help with debugging this piece of code. I know the problem is in malloc and free but can't find exactly where, why and how to fix it. Thanks. [CODE] #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <unistd.h> #include <string.h> #include <sys/wait.h> #include <sys/types.h> #define MAX_COMMAND_LENGTH 256 #define MAX_ARGS_NUMBER … |
|
Write a function called nRandomNumbers( ) to performing the following: • Generates N random integers between -250 and 250 (inclusive) and save them in a file called number.txt, (Use the function srand()). • Prints all the generated integers. • Finds the average of all the negative integers, and the maximum … |
|
I'm currently trying to create a code in Cygwin using pure C to display ASCII control characters that may be present in the text file in a ASCII control characters non-printable form. I can call to a text file to display its contents but in normal ASCII characters but I … |
|
Hi everyone, Ive been asked to do an assignment to test the randomness of a linear congruential generator..We've been given the code implemented in c..the problem is i dont really see how this code relates to the theoretical LCG equation i.e X[n+1] = (aX[n] + c) mod m..So i would … |
|
Hi All, I am new to C language and am suppose to write a program that gives me an even integer with cube greater than 40000 and also is divisible by 7. This is what i have... [CODE]#include <stdio.h> #include <stdlib.h> #include <math.h> int main(){ float a,b,c,d,e; a=pow(40000,1/3); while(pow(40000,1/3)<=a){ a=b; … |
|
I'm having trouble running C in eclipse. It first gives me weird syntax errors or tells me that # include <stdio.h> is an "Unresolved inclusion" It also will not let me build, saying "(Cannot run program "make": Launching failed)" Am I missing something? please help. Thanks |
|
hi all do anyone understand hash function? how to use it in order i can count a digit number of size 10? then i separated it half half (into 5 digits each) :) |
|
//*************************SERIOUS PROBLEM, NOT WORKING****************** [CODE]//DOUBLY LINKED LIST #include<stdio.h> #include<stdlib.h> struct dll { int info; struct dll *next; struct dll *prev; }; struct dll *head = NULL, *tail = NULL, *temp; void append(); void insafter(); void delete(); void display(); void main() { int choice; do { printf("Enter your choice:\n"); printf("1.Append Node\n2.Insert … |
|
[CODE]int main(){ char i,input[30],close,open; for(i=0;i<='.';i++){ printf("enter equation"); scanf("%c",input[i]); if(input[i]=='(') input++; input[i]=open; else if(input[i]==')') input[i]--; input[i]=close; else if(open[i]==close[i]) { printf("paranthesis are balance"); } else printf("paranthesis are not balance"); } getch(); return 0; }[/CODE] |
|
Help please.. I need some help in C to open a file and search for a string. If the string is found then move one space and copy the next string to end-of-line back to buffer. I am creating a program using pthreads and need to search this file in … |
|
i want to write this program without lib and string files make changes in it and tell me the program thanks code is below[CODE]#include<stdio.h> #include<conio.h> #include<stdlib.h> #include<string.h> struct Node; typedef struct Node * PtrToNode; struct Node { char element; PtrToNode Next; }; PtrToNode MakeEmpty(PtrToNode L) { L= new(Node); L->Next=NULL; return … |
|
Hi, I have a file in C which has many lines. I want to store each line separately so that i can reference it later with a char *host. How can i do that? Thanks. |
|
Hello guys, I started this project but cant seem to finish it. You guys are my last hope, any help would be GREATLY APPRECIATED.These are the requirements, it seems I am mixed up. The owners of Body Language Fitness Centre require an information system that can manage and maintain their … |
|
This is begining. BALANCE PARANTHESIS and show the result of ((9-4)/(44*34)) etc ??? what to do? int main() { char arr[30]; for(int i=0;i<30;i++){ if(c=='(') c++; else if(d==')') d++;} if(c==d) printf("parenthesis are balance"); else printf("are not balance"); } further cant understand. |
|
Hello Daniweb. [B]Scenario[/B] For a project we have to write a irc server. For this, we first wanted to investigate what kind of server architecture we should apply. (e.g. multithreading, multiplexing, multiprocessing etc.) We've written simple servers which implement different architectures. The servers basicially receive a message, and then send … |
|
Hello, I am trying to get the following code to print out the number of days in each month using pointers. This what the program currently prints: Enter a year (ex. 1997): 2001 Year entered: 2001 --Not a Leap Year!-- Number of days in each month: January: 0 February: 0 … |
|
how can i add the last value to the current value using loop..? i tried so much but didn't find the answer :( [CODE]void main(void) { int numbers,add,sec; clrscr (); for (numbers=1;numbers<=49;numbers++) { for (sec=numbers;sec<=numbers;sec=numbers+sec) printf ("%d ",sec); } getch(); }[/CODE] here the loop is from 1 to 50, i … |
|
hi everyone... i"ve to pass a string as a returning value.but wat is the problem is there is an integer in the middle of it.the problem arise here.. [code]char* my_string( char* dest,char *c) { char str1[25] = "C:\\windows\\"; char str2[25]; char str3[25] = ".jpg "; strcat(dest,str1); //append str2 to str … |
|
Hi All, How to copy one 2D-array to another without using loops and library function of C. Not pointers. Regards, Pramod |
|
hi guys i have an urgent problem....we have been asked to make a battleship game in C which will have the formation of ships taken by a file txt.....for example 00000000 ppp00000 0000nnnn 00000000 etc...i want to open the file txt and then put every single character 0,p,n etc to … |
|
Hello Guys, I have implemented a linked list. And my output looks something like dis: ************************************************* The elements in the list : address is = 163196952 ADOC1100250100000119666 address is = 163196968 ADOC1100250100000119666 address is = 163196984 ADOC1100250100000119666 address is = 0 ADOC1100250100000119666 TOTAL NO OF ELEMENTS IN THE LIST ARE … |
|
Hi, I am stuck in file reading problem. I have tried various solutions but nothing worked. Actually I can't develop a logic to do so. I want to read some lines from file and pass them to structure. When reading a file you must use WHILE loop. I am posting … |
|
Does anyone understand why Data2 would not equal Data? I print, and can see, that they LOOK the same, i.e. have the same number of rows and columns with the same values in each element. But when I pass the matrices to a calc function, they give different results. I … |
The End.