15,552 Topics
| |
int c; while ((c = getchar()) != EOF) In the above code, why it is prefereble to use variable 'c' as integer datatype rather than character datatype eventhough we are assigning characters to 'c' ? Can any one explain clearly?? | |
I'm currently working on this course assignment and I'm trying to set up code to search within a database file (really its just a text file named a1.db). I hear we can use the popen function to implement shell code within a C program so here's what I tried: ---------------- … | |
Hey guys , I need some help in writing a C code for a calendar problem. I need to write a code to find the day of the week if the month and year are entered by the user. Not able to get the logic for it. I need this … | |
This is a program for getting the sum of prime numbers of given range. The problem is that it would take hours if the limit is about 1000000. I've read about the sieve of Eratosten but having difficulties with implementing it. Could someone help to make this piece of code … | |
I want to parse through a root folder which is entered by the user by using multi threading and multi processing at different versions.But how can I distinguish while I am parsing through a root folder whether the next is a folder or a file?To summarize I want to learn … | |
#include<stdio.h> main() { int a=10; printf("%d %d %d\n",a=10,a=20,a=30); } o/p: 10 10 10. Here, the latest value is updated and printed as the expression statements separated by commas in funtions are evaluted from right to left. But, in below program by using global variable or static variable why the updated … | |
hi, im a beginner. i hav an assignment on Pascal's triangle. i saw some post over the topic but couldnt get it to work with my code. heres what i have done so far.... [code=c] #include<stdio.h> #include<conio.h> void main() { int a[10][10]; int i,j,c,n; clrscr(); printf("Enter how many lines do … | |
There is a code snippet [CODE]Int matchstar( char c, char *regexp, char *text) { Do { /* do sth */ } while (*text != ‘\0’ && { ‘text++ == c|| c == ‘.’}); Return 0; } [/CODE] I do not understand how does the logic in while work, in specific, … | |
hello all, following is the code that fetches required columns from r.csv and makes a new file. now i want to ignore first line of r.csv while fetching defined column . what should be done? [CODE] #include <stdio.h> #include <stdlib.h> int main() { FILE *in, *out; char ch; char *rdf,*wdf; … | |
hello, what book will you suggest me to read if i want to learn gui using c language.? | |
I have a question here.. i have 2 files with me list of usernames and a list of passwords i need to write a program to check each user name with the list of passwords. Then need to go to a website and see if it logs in. I am … | |
Hey hombres. I feel a bit embarassed to ask something so simple,but i need help with qsort. As you will understand,im trying to sort my table made of "catPage" structs,which are read from keyboard,comparing the lName strings. First i print the struct array unsorted,then sorted,but what i see printed is … | |
so I want to take the totalPoints divide it by 850 then multiply it by 100 giving me a whole number, my problem is when i use my printf to display the new total it comes out at 0 or a number that i wasnt expecting. [CODE]totalPoints=grade1+grade2+grade3+grade4+midterm+attendence; printf("total points so … | |
How can i read some number from a text file and then go back to read some other information? All i know, is read it from the beginning to the end, but even when i check something for ex if(fgetc(in)!=...) goes forward one character, and all this messes up my … | |
Hello, I'm new with C and I've almost finished this little program but something is wrong. The program reads in a list of names from the file names.txt that I put right in C:, and prints the list to an out file called trans.txt (which it creates on its own) … | |
Hey can someone help me with a code to mask password. To print * when the user enter a value and when they hit backspace it takes back a *. Im having trouble figuring out the code | |
Here the val should print the max number but its printing some address. When i tried to print while in loop, it printed the largest number but in the next line it again printed the address. please tell me whats wrong. Thanks [code=c]#include<stdio.h> #include<conio.h> int main() { int arr[5][5]={ 2,4,8,11,15, … | |
I need some help with the toupper code. [code] int main() { char pick; printf("A. Local needs\n"); printf("B. Local Service\n"); scanf("%d",& pick); switch (pick) { case 'a': printf("Hello World"); case 'b': printf("Hello Nation"); } getch() return 0; } [/code] How would i implement the toupper code so i could change … | |
| [B]I've tried out suggestions from several posts related to BGI Error (on daniweb n innumerable sites)but it just doesnt get solved.. Whenever i try to execute (after compiling successfully) a graphics program it either exits out of C and into DOS mode or it gives an error "The NTVDM comp … |
Hi Friends, -The current connector for accepting request to our existing system is written in C language,we had build a ".so" file by compiling c program using MF cobol. -Cobol application calls this ".so" files and passes the required buffer.The current data structure in our application is simple string. -Now … | |
Hi All, Just starting my online C programming class and my textbook states "In a computer language, a token is the smallest unit of the language that has a unique meaning. Thus, the reserved words, programmer-created identifiers, and all special mathematical symbols, such as + and -, are considered tokens … | |
How to write a structure that set a countdown of days at 30. After which the days have expired, produces an indicator? | |
Can somebody please help me with the c code for monitoring System power,that is how to check if a pc or laptop is running on power or battery | |
I am trying to make a program that will read in a text file and count the number of words that have a certain length from 1 to 20. So it should count the words that have a length of one, two, etc., and print it out. I have been … | |
hEy pLz sOlve this pRobLem pls?. .Enter the grade of ten students and will display the number of students who passed and failed granting a passing score of 75 and above. | |
To be honest i really don't know where to start or what should I. The problem states, "Given the vertex pairs associated to the edges of an undirected graph, find the degree of each vertex." I.e. (A square has 4 vertex then the degree of each vertex is 2.) It … | |
Hi, When we define any integer array like int a[3]={1,2,3}; then it will assign the values as a[0]=1, a[1]=2, and a[2]=3 But, when we define any character array as char a[3]={'a','b'}; then compiler here automatically consider '\0' null character to represent the end of the string So, my question here … | |
Hi Guys, I was wondering how one would write a C program that calculates the value of a cosine function without using any library functions from <math.h> I need the outputs to turn out like this Case 1: cos(-1.000) = 0.540302303792 Case 2: cos(1.000) = 0.540302303792 Case 3: cos(1.500) = … | |
I am really trying to pass this class, and am simply struggling majorly with C, I need help with these 3 problems that are due today by midnight, please help, will appreciate it greatly, and even pay if thats what it takes. I did problem 1, but used math.h, which … |
The End.