15,551 Topics
| |
Hey DaniWeb. I am getting stuck in an infinite loop when I input a character instead of an integer during a scanf("%d"....); I know this is because C doesn't provide any built in error checking. I know I can fix this by using getchar() in place of scanf, and changing … | |
I just hit a brick wall. I'm writing a code that will ask a user the height of a pyramid an output the corresponding pyramid with * characters. I got that part working but now I need to turn it into a half pyramid like so: * ** *** **** … | |
Say i just do a simple printf statement [code] printf("i want this text to be different color > %s", thisbit); [/code] i want whatever i print out at the %s (the string) to be different color. Im sure it only something little that why i ask. | |
how can i code this player1=rock player2= paper player two wins please help me | |
its been a week already since ive been trying to answer our project in programming but it seemed that i found no answer to it.....it wont run!!!!so i decided to ask for your help!!!this might be simple to you but if you can give me a code,,,id really appreciate it!!!.............i … | |
[QUOTE=ramesh vankayal;1154302]i want to mini project c and dbms[/QUOTE] hiiii.....can you help me in blowfish algorithm...i want to know about the secret keys which are used in encryption of password,...please help me !!!!! | |
Thanks for your help so far that i have achieved my goal. My other problem is updating a particular record using fseek() [CODE]void updaterecord(void) { system("color 2"); struct custinfo info; FILE *customer1; customer1=fopen("customer1.txt","r"); if (customer1==NULL) printf("\n\n\t\t\t FILE WAS NOT FOUND "); else { char choice4; char Target[50]; int Found=0; if((customer1=fopen("customer1.txt","r"))==NULL) … | |
[CODE] #include<stdio.h> int main() { FILE *reading; FILE *writing; int condition,condition2; char input[100]; char save[100]; printf("Type a name to open for reading : "); scanf("%s",input); reading = fopen(input,"r"); /* OPENS the file name we typed above for reading */ if(reading != NULL) { do { condition = fgets(save,30,reading); printf("\n%s",save); }while(condition … | |
My input file contain: 1 2 3 4 5 6 why is it not reading properly, i tried implementing fget and fread but failed even after reading dani web and other tutorials. [CODE]#include <stdio.h> #include <stdlib.h> #include <conio.h> typedef struct{ char lname[20]; char fname[20]; int salary; }employee; const int max … | |
so far the address book is compiling and takes in entries and runs all the other functions but the search and delete methods don't work even though I have the entry entered in a file and the code should use that very same file to display the names etc if … | |
[CODE]#include <mega8535.h> #include <delay.h> #define clk DDRA.0 #define dio DDRA.1 #define cs DDRA.2 #define diopin PINA.1 #define clkx PORTA.0 #define diox PORTA.1 #define csx PORTA.2 #define OUTPUT 1 #define INPUT 0 #define LOW 0 #define HIGH 1 // Standard Input/Output functions #include <stdio.h> // Alphanumeric LCD Module functions #asm .equ … | |
Hi Friends, I have a small doubt about pointers, One of the Advantage of the Pointers is "FAST ACCESS" comparitively to variables My doubt is How can it be? a Pointer stores a variables address, whenever it accessed it goes to that particular address and retrives the value... Similarly,a variable … | |
hi I'm having a problem with my addressbook recognizing the data I've inputted into it (displaying and deleting) It stores the data into a txt file and should use that file to pick up any similarities when the user inputs a similar name. So far it compiles and displays options … | |
Hello, I am trying to write a function such as: [CODE] printValues(int nInts, int nFloats) ; [/CODE] nInts describes the variable number of int values passed, and nFloats describes the variable number of float values passed. Normally I would think of doing something like: [CODE] printValues(int num1, int num2, float … | |
Hi, i know its probably the easiest thing ever, but im a noobie in c, and in need of some help with fmax function, i just dont really get it. im trying to compare 3 floats heres what im trying float fmaxf (float int1, float int2, float int3) im not … | |
[CODE]#include<stdio.h> #define CR 13 #define LF 10 int main() { FILE *tg; FILE *th; FILE *printer; int i,a; char input[20]; char file[100]; char input2[20]; char file2[100]; printf("Enter the file name for reading : "); scanf("%s",input); th = fopen(input,"r"); printer = fopen("PRN","w"); do { i=fgets(file,100,th); putc(i,printer); printf("\n\n%s",file); }while(i != EOF); printf("Enter … | |
i need the help of a [B]turbo C master[/B]!!!!...one of my final exam problem in my subject has this problem: [B]The Department of mathematics has asked you to develop a program to help elementary students check their addition and subtraction computations. The program to be developed will ask the user … | |
so im working on a mid-term exam average program of a class of 10 students. would my code start as follows?[CODE]void getnames(char stuname[10][20]) { int ctr; for(ctr1=0;ctr1<10;ctr1++) { printf("Enter Name %d ", ctr); scanf("%s",stuname[ctr]); } void printnames(char stuname[10][20]) { int ctr2; for(ctr2=0;ctr2<10;ctr2++) { printf("%s\n", stuname[ctr2]); } [/CODE] and have getNAME … | |
Is there any way to make the compiler remember the last integer value it wrote to a file. i declared the value as a static but after i write to the file ,the value goes back. | |
Hi I need help regarding the above question, ive tried to type: "DWORD file;" but the compiler says its undeclared. WHy? isnt DWord 32 bits? thks. | |
* * * * * * * * * * * * * * * i want code for this.pls giv me the code | |
A five-digit number is entered through the keyboard. Write a program which will re order the digits of the number from smallest to highest. Like, if you enter 54231 the program will show output as 12345. help me. | |
Hi , i have read that new line character gets converted to \r\n when writing characters to a file and converted to new line again when reading. but i observed one thing here. i have written contents hello followed by return key . and i have written a program to … | |
Im mid way through writting my own c shell and having trouble with my redirecting, i use strtok to spilt the input into 2 parts, argv0 being command and argv1 being cmd i have this for redirecting so far [code] if(strcmp(cmd,">")==0) { strcpy(filename, command); filein = open(filename, O_RDONLY); dup2(filein,0); close(filein); … | |
please give the program in turbo c language for first in first out page replacement and least recently used page replacement ? | |
//Trying to read double values from each line of a file..and try to store them in arrays //when i debugged,it doesnt do the parsing for the alldoubles e.g txt file consists 2.3,4.5,6.2,4.5 2.8,2.4,4.6,1.2,3.5 3.6,3.8,5.9,4.9,12.6,112.8 trying to put them in separate arrays [code] //CODE?? #include <stdio.h> #include <stdlib.h> #include <string.h> FILE … | |
" fscanf " plzz help me the format of this function and brief explanation?????? plzzzzz help ...... needed...... | |
Dear All, I am a C code to calculate prices in stock market. I pass a two dimensional array to a function as [CODE] #define DIM 3000 void grid(double tree[][DIM]); int main(){ double tree[DIM][DIM]; grid(tree ); return 0; } void grid(double tree[DIM][DIM]){ /* and do sutff on tree * } … |
The End.