15,552 Topics
| |
#include <stdio.h> #include <conio.h> #include <stdlib.h> struct exchange_rate { char name[50]; float rate; }; int main() {struct exchange_rate x[50],adaus,caut[20],aranj; int i,n,q,k,z,d; float aux,max; char w; int lungime; FILE *f1; //afisam meniul m0: system("cls"); printf("\n\t\t***MENIU***\n\n"); printf("\t1: Filling database.\n"); printf("\t2: Reading the database file\n"); printf("\t3: Introducing a new registration\n"); printf ("\t4: Cautarea … | |
Iam beginer in this field. While trying a code to implement fprintf & fscanf, iam getting errors. Please help to explain the cause of error. Code Snippet ================ #include <stdio.h> int main () { FILE *fp; int num; char sstr[100]; fp = fopen("myText.txt", "w"); fprintf(fp,"%d %s",9898,"visakh"); /*sscanf(fp, "%f %s",&ffloat,sstr); printf("Float … | |
Hi. I just got a problem running my graphics program written using C language in DOS Box. There may seem a problem using the graphics.h running through DOSBox in Windows 7 ultimate 64bit. The program just flickers fasts when I run it. I know that my program is correct and … | |
Apperently there is an undeclared identfiier "stdprn". Please help /* PRINT_IT.C-This program prints a listing with line numbers! */ #include <stdio.h> void do_heading(char *filename); int line, page; main( int argv, char *argc[] ) { char buffer[256]; FILE *fp; if( argv < 2 ) { fprintf(stderr, "\nProper Usage is : "); … | |
Is this a "typedef" problem? This is the definition in one file. typedef BYTE SOCKET; //Socket descriptor BYTE is defined elsewhere as type char. (I made sure the file where SOCKET is assigned a type is included in the file the problem is in.) This is one place it is … | |
I'm creating a basic C program that I want to accept both positive and negative inputs. However, as it is it doesn't accept negative inputs. Any help on how to fix it will be much appreciated. here is the code: int main(void){ // Here we declare integer and floating point … | |
i want hexadecimal addition program without converting it into any other base n without use of %x..... | |
Hello guys, i have a simple doubt. One problem I am not getting. Read a text file and add a line at the end of it. '-' Does anyone have any idea? | |
Hello! This is mainly a curiousity question, I may apply it to something in the near future though just as an added twist... :D So essentially I want to figure out how a progress indicator is created in the shell. For example with wget or something you may see a … | |
Write a C program to create 3 child processes which read from 3 different files and write to the parent process using pipes. Each child should wait a random amount of time (3 -10 seconds) between writing each 50 characters. The father should read from pipes and write everything he … | |
Can some one tell me that global variable are static bydefault or not? | |
**I have a struct of students that written to a file all what i want is intial the array with values from the file using any method , the aim is to put the struct values into array to help sorting process the code gives me punch an kick any … | |
Hello! I have a exercise about matrices. here is the question: is given a square matrix [M] [N] which determines the amount of each column. Thank u! | |
HI i got stuck in this program please help me and provide me the source code,.. | |
Can someone please tell me what is wrong with strcmp? I don't understand why I am getting a segmentation fault when comparing array of strings and string. char *strings[100]; char nam[100]; int g = 0; while (fscanf(pFile, "%s %d", nam, &val) !=EOF) { strings[k] = nam; printf(" string is %s … | |
** # i am tring to merge two array but every time its display first array proparly but in second array its only display last element....thx....# ** #include<stdio.h> #include<conio.h> void main() { int a[10],b[10],i,j,c,d,e; clrscr(); printf("how many number in first array="); scanf("%d",&c); printf("how many number in second array="); scanf("%d",&d); printf("\nenter … | |
So here's my problem I have inner structure inside of client. How can I know while reading from txt file that I'm reading item data or client data for my list? struct item { char item_name[30]; char item_state[30]; float item_price; char item_status[30]; float item_price_if_not; struct item *next; }; struct client … | |
Can someone please tell me the the maximum and minimum of int, long int, long long int, double, float, and anything bigger than that? And also how to calculate this? | |
Here is the mex code I wrote to read in a tab-delimited file. The mex file got created but it causes my MATLAB to end abruptly and give the following error. Can anyone help me where I am going wrong? Please let me know if any further information is required … | |
I am unable to convert my C file to mex file. Here is the C file I wrote to read in a tab-delimited file. The C program in running, but I am not able to successfully convert it to a mex file. I have also pasted the mex file I … | |
I am trying to read in a large tab-delimited file which has 16 columns and about five lac rows. The first column is a date string. TThe second contains integers and so on. However I am not able to get the arrays correctly. Also how can one ignore three header … | |
**i am tring to this way but answer is not write....thx...** #include<stdio.h> #include<conio.h> void main() { float a[10],m; int i,j,n,t; clrscr(); printf("how many number in array\n"); scanf("%d",&n); printf("enter %d number\n",n); for(i=1;i<=n;i++) { scanf("%f",&a[i]); } for(i=1;i<=n;i++) { for(j=i+1;j<=n;j++) { if(a[i]>a[j]) { t=a[i]; a[i]=a[j]; a[j]=t; } } } if(n%2==0) { m=a[(n/2)+((n/2)+1)]/2; } … | |
I'm new to C and I'm trying to convert decimal to binary. The result is giving me an inverse number of what's required. I tried to apply modulo on the result like I saw on other forums but I still get the same result. Any help? #include<stdio.h> int main() { … | |
A complete C implementation of Linked List...tested on Linux GCC | |
I'm trying to make make project for my programming class. All that's left is deleting elements and editing elements. Basicaly my question is how would I do it for my inner list? Or how would I delete single client from list? Would I first have to free the client's inner … | |
I am trying to use fscanf to read a file. When fscanf hits a newline I would like it to do one thing and when it hits a space I would like to do something else. Is this hopefully possible? char nam[100]; while (fscanf(pFile, "%s", nam) !=EOF) { if(space) //do … | |
Which file readers in C can handle reading an inconsistent file? Sometimes the file is "word number" and other times it is just "word". Like this. bob 456 echo cat dog 1101 peacock 300 This is what I tried with fscanf. I am surprised it worked. I didn't think fscanf … | |
Hey there, I'm having a problem and I tried several times to solve this problem maybe you could help. I need to modify the program below so that it asks the user to enter any number other than the number equal to the number of times they've been asked to … | |
Im writing project for my programming lessons and right now got some problems with output from function AddItemToClient, basicaly its mainly with date, in first node its correct one but after this its just random. Could someone explain what I'm doing wrong here? #include <stdlib.h> #include <time.h> #include <string.h> #include … |
The End.