15,551 Topics
| |
I have problem reading file form command line. I am trying to do " abcd: ./rev < numbers", but it gives me an error: ./rev < numbers Usage : ./rev FILENAME Here is the code: #include <stdio.h> #include <stdlib.h> void reverse(FILE * file) { int fscanf_return_value; char x; /* read … | |
The program i want to code is user will enter 2 ebook title,edition,year and pages.After that must write to binary file and read the binary file again to found the book with the highest pages.The first problem is why i cannot use this statement. printf("Enter ebook title: \n"); scanf("%s",mybook.title[i]); I … | |
The goal of my assignment is to create a program that takes a string of words and encodes or decodes the string using a simple substitution cypher. I've gotten a decent amount done but I am stuck at the part where I actually have to encrypt and decrypt using the … | |
Hi, I have jpeg image of JFIF type, i want to read jpeg image, decode it and finally i want to display this image in a screen. Could anyone explain me the parsing of jpeg binary data for decoding and encoding? Thanks in advance | |
I read a sample code from a development kits. The global array is declared without indicating the array size. I wonder is it safe? Here is the code: #include <stdio.h> // For Used Function printf // UART Buffer char uart0_buf[]; // "sprint" UART[0] Buffer char uart2_buf[]; // "sprint" UART[2] Buffer … | |
I have more than one version of berkeleydb installed in my linux box and when I use -ldb to link berkeleydb to my c code I couldn't know which version is linked to. Please tell me which version is used by linker. I can't configure eclipse cdt with berkeley db … | |
hy guys can you please tell me what s wrong with the folowing code float a,b,c; printf("input three numbers:\n"); scanf ("%f%f%f",&a,&b,&c); float z=sqrt((1/2)*(pow(a,2.0)+pow(b,2.0)+pow(c,2.0))-(3/4)*pow(a,2.0)); printf("res is %f",z); getch(); return 0; | |
Hey guys, I am trying to implement the following but the compiler is not liking it. What can I do to fix this? Thanks for any help. typedef struct { int ordinalSum; int LexemeCode; Line Info; Node *next; <-- ??? }Node; error # 1 syntax error before "Node" | |
#include<stdio.h> int main(){ char inputs[33]; int i; for(i;i<33;i++) inputs[i]=' '; int ch; for(i=0;(ch=getchar())!=EOF&&i<32&&ch!='\n';i++) {printf("%c",ch); inputs[i]=ch; } inputs[i]='\0'; printf("%s",inputs); return 0; } I am writing a program where the user enters a character and the program stops asking the user for a character when the user enters the Enter key. Enter … | |
I'm trying to develop my own simple uptime command (used to show how long the system has been running) like program where I'm gonna use it for our university's OS, (consider the OS already has all the necessary C libraries needed to make system utilities) Could someone give me a … | |
I was going to post this in a thread, but it turned into something a bit more serious and may be useful as a code snippet. The code shows three files: * menu.h: The header file for the menu library. * menu.c: Implementation of the menu library functions. * main.c: … | |
Hi, i am trying to make a server client application using sockets in C. Server and client compile just fine but they dont seem to connect with each other and i don't understand why (i just started learning about sockets). My OS is SunOs 5.10. This is my server code … | |
What is the difference between Definition and Declaration of a variable? Am not talking about function, but variable. When I googled, I found these two answers which are quite contradictory! While one says "definition occures once through the program( memory is allocated once ), but the declaration can occur many … | |
please help me to write a code which includes a function for calculating the squareroot of a number without using the predefined functions in the function header............ | |
i need to use webcamera to take picture to gimp....i need a plugin so plz help me out i dnt know how to connect webamera to gimp...somebody plz come with a code explenation | |
#include<stdio.h> #include<conio.h> #include<dos.h> void main() { int minutes,seconds,timeremaining,input=1; char cAns,cAnswer; clrscr(); gotoxy(35,15); printf("Press S to start the game: "); cAns=getche(); if(cAns=='S'||cAns=='s') { clrscr(); printf("\nAre you a human? Y or N: "); scanf(" %c",&cAnswer); timeremaining=input; do { input=timeremaining; minutes=input/60; input=input-(minutes*60); seconds=input; gotoxy(1,1); printf("%02d:%02d",minutes,seconds); timeremaining++; delay(1000); }while(timeremaining<=90); if(timeremaining>=90) { clrscr(); gotoxy(33,12); printf("TIME'S … | |
I have a very confusing question to ask and it is the difference between array of pointers & pointer to an array. I want to understand this concept very well so please please do help me understand this concept. I'll start with what I have understood about array of pointers. … | |
The following code gave error on gcc compiler int main() { extern int a; printf("%d",a); return 0; } static int a=5; But when static is removed from int a then it runs with no errors..Can someone please clear the doubt?? | |
I just want to ask if i can run a timer at the same time with my program? It is like a quiz bee, i'm asking questions and there is a specific time to finish answering. Thank you! | |
I am getting wrong output. My Code is following, in which I have to use function unsigned long powerof2(int n); #include <stdio.h> #include <stdlib.h> #include <math.h> //int powerof2(int n); unsigned long powerof2(int n); int main(void) { printf(" n 2^n\n"); printf("-- ---\n"); for (int n=0; n<65 ;n++) { //printf(" n 2^n\n"); … | |
I am trying to print: 0 1 1 2 2 4 3 8 4 16 5 32 6 64 7 128 8 256 9 512 10 1024 11 2048 12 4096 13 8192 14 16384 15 32768 16 65536 17 131072 18 262144 19 524288 20 1048576 21 2097152 22 … | |
hi i am trying to read a file and save to array i wrote one and it worked accept it not reading ot line by line, so i wrote another one but i am trying to make it as function when i make function call i get this error read.c:32:13: … | |
hi i have this small problem in my code which is that when i run the code it enters to the wrong condition i mean in the if clause where i enter "download" it executes the body of the upload even though the first if clause condition meet and the … | |
I type in <graphics.h> and "graphics.h" for terminal on my mac and it says fatal error: 'graphics.h' file not found Please help me. | |
the foll code when run on gcc compiler gave 12 as output `struct aa{char a:3;int b:30;char c:3;}; printf("%d",sizeof(struct aa));` but when i replace size of c to 2 then it gives 8 why is that so?? sizeof int is 4 and char is 1.. | |
This code calculated the variance to be 9.75. It really is 9.3, what am I doing wrong? static double computeVariance(ref double Variance, params int[] intValues) { int sum = 0; for (int n = 0; n < intValues.Length; n++) { sum += intValues[n]; } double avg = sum / intValues.Length; … | |
There are a 10 words in statement.i want program in 'C' to find out how many words have the same number of letters | |
I need to write a right turn code for a micromouse using sensors but I don't know where to start. Can you help me please? This is the algorithm we developed. > // Right turn while sensor 1 is OFF // initialize RTcounter = 0; if (sensor 6 == 0) … | |
My Program contains 4 arrays and I want to sort the array in such a way that if one array is sorted the other array should follow it Example: unsorted array name code salary date John 52 6500 15 Suzzy 10 1500 20 Mike 20 1451 16 Sorted array(according to … | |
Hi friends... I need to write a program in C which will print all the combinations of a string with non-repeating characters. Example: “Say” will have the following: s, a,y, sa, sy, as,sy, ys, ya, asy,sya,ysa and so on. The string length is not known. The string will be a … |
The End.