15,551 Topics
| |
Is there a straight way to compare variables from 2 different C programs in Visual Studio? The only way of variable comparison I can come up with is writing them to the disk using file handling and then comparing them using a third program. Does Visual Studio allow variables to … | |
Can someone please explain why "#include <stdlib.h>" fixes "warning: implicit declaration of function". Also what does #include <stdlib.h> mean and when should you use it? | |
How can I create a semaphore using the above functions that will allow [I]any[/I] process access to the semaphore? I've been playing around with global variables for hours thinking I was doing it wrong, but now I believe I was misled. I think the problem is that the other processes … | |
Hello everyone, I'm having trouble with a code I need to write, I have never coded in C and I need to do this program in C. I have created my checksum code already and need to implement this: I need to send a complete ASCII file in 128 byte … | |
Hey everyone, I am a brand new member and thought I could learn and get some help at the same time. I have an assignment that implements SECDED on a 16 bit word, storing the 5 checked bits and 1 parity bit in the upper 6 bits (makes a 22-bit … | |
[CODE]#include<stdio.h> #define sqrt(x) x*x int main(){ int x=5; int y=sqrt(x+1); printf("%d\n",y); return 0; } [/CODE] The answer is 11. Can anyone explain why? thanks | |
I need help with writing a code that can count the number of functions and member functions per class! Please! | |
In the following code I am calling a function from a pthread: [CODE]pthread_create(&threads[t], NULL, dnssearch, (void *)buffer)[/CODE] I need to pass the string (buffer) to a function and the have the function pass a string back. What am I doing wrong in the function: [CODE]void *dnssearch (void *buf) { char … | |
Hi, If I want to pass values of one array to another array, is this the proper code implementation. any alternative or suggestions Thanks. . . . for ( i=0; i<9; i++) for (j =0; j<9; j++){ receive[i][j]=transmit[i][j]; } . . . | |
Can someone please help me with this program? My goal is to create a test driver for the function put_result(). The program compiles and works as intended. However, I came across a bug that I am having an extremely difficult time trying to fix. I tested for several inputs and … | |
[CODE]char **makeString ( const int numOfArrays, const int sizeOfEachArray ) { /* Function to create an array of strings: ( Array of pointers to strings ) */ /* Local variables */ int i, j; //int numOfArrays = 6; /*char stringsToCopy[6][12] = {"Hello", "Good-Bye!", "Greetings", "Pointers", "Arrays", "Programming"}; */ char **stringArray … | |
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. |
The End.