15,551 Topics
| |
Hello, I am very new to C but need to use it to resolve a problem. I have a variable called "W12". All I want to do is increment W12 to W13, W14 etc and then use it later in my code (I am using QA Load to load test … | |
I want to read all files in a particular folder using C programming. HOw to do this. Thanks. Ex: I have some 5 files in folder named c:\temp. I want to read all files one after another and want to write output file for each input file. The output files … | |
I want to read data from a file with the following information: -An integer n (between 1 and 5) -n Rows of n integers Example: [CODE]3 8 1 6 3 5 7 4 9 2[/CODE] Which means displaying a 3x3 matrix with the numbers 8 through 2 each in a … | |
Hello, I've been searching all around but I didn't found a link about this. I want to get a html, and use like it was a .txt in fopen, so that I can read it. Does anyone knows how to do this in C? I can use a .html in … | |
Hi, I have been working on this program for quite some time but I can't figure out what's wrong with it. The program compiles and this is the the output I get: ?Invalid number of arguments Press any key to continue . . . Can somebody please take a look … | |
[CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> int strcmp(const char *s1, const char *s2); void overdue(); int main(){ overdue(); } void overdue(){ int x,overdue_fees; char answ[10]; char yes [10] = "yes"; char no[10] = "no"; int ret = strcmp(yes, no); system ("cls"); printf("\n <<<<<<<<<<<<<<<<<<<<<<<<**********OVERDUE ITEMS*********<<<<<<<<<<<<<<<<<<<<<<<<<< \n"); printf("\n"); printf("PLEASE ENTER BARCODE OF … | |
I'm having difficulty breaking out of this nested loop. This is a function for reducing a fraction. Normally original_num and original_denom will be numbers that are reducible and z will normally be the GCD. Sometimes like in this particular that you see here 37 and 51 are not reducible. The … | |
thanks for all the help that i have been getting but can anyone suggest how i may read a 4 character string from a text file then compare it to an input from the user then print the relating information | |
Hey respected users and developers, I am a newbie to this pool of c... I am just 14 yrs old.. Plz send me free link to plearn pointers in c.. i hav downloaded many books but all of tem are useless.. The language used in the book is so difficult … | |
My problem is that..... whenever i try to run a graphics program in c on windows vista,it does not since it is not supporting fullscreen mode. please tell how could i run graphics pro do i need visual c??? | |
how do i want to add search funtion by matric value to get the info of the student add this code[ICODE]#include <stdio.h> #define MAX 10 struct studenInfo{ char name[81]; char matric[71]; }; int main() { struct studenInfo library[MAX]; int menu (void); struct studenInfo add(void); void list(struct studenInfo*sp, int size); int … | |
[code]#include <conio.h> #include <stdio.h> #include <windows.h> void display(void); void menu(void); int main() { char username[9]; int password=0,x=1; display(); do { printf("\n\t\t\tPlease enter your username:"); scanf("%s",username); printf("\n\n\t\t\tPlease enter your password:"); scanf("%d",&password); //problem if (username == 'udental' && password == 1987) menu(); else { printf("\n\n\t\t\t YOU HAVE MADE AN INVALID INPUT"); printf("\n\n\t\t\t … | |
Hi, I basically have a Token of type char *token written from a custom tokenizer.C and H file. What i want to do is parse that into individual characters such has if that char *token is {4r$a$} i want a char arr {4, r, $, a, $}, rather than the … | |
Dear all, I am working on the code below: [CODE] int cookTime(int time) { int second, minute; for (minute = time; minute > -1; minute--) { for (second = 59; second > -1; second--) { sleep(1); printf ("%i", minute); printf (" : %i\n", second); } } } [/CODE] Now this … | |
Hi all, Im trying to use a variable as a path in C. For instance, the user enters a directory and this is used with the '*.*' notation attached so the program loops all files in the directory. I've got the PHP part of this code working in a separate … | |
Hi everyone.. Suppose i have a function : [B]void foo(int ind,float **ptr1,float **ptr2[/B]) that allocates memory using malloc .. - double pointers are much more in reality- I want to use this pointers in other functions too, but when i call them(functions) in main() .. memory leak message appears .. … | |
I am trying to read input form the user and then print them to a file but the compiler is giving me some error about invalid pointer at the fprintf statements [code]void addrecord(void) { struct custinfo info; FILE *customer; printf("\n\n\t\t\t PLEASE ENTER THE CUSTOMER INFORMATION BELOW"); printf("\n\n\t\t\t REGSISRTATION NUMBER"); scanf("%d",&info.regis); … | |
hello everybody, I have one project due on this sunday....please help me with this.....any clues hints would be highly appreciated.....thanks a ton This project will require you to develop three C functions: float nandFloatMul(float a, float b) float nandFloatAdd(float a, float b) float nandFloatSub(float a, float b) Each of the … | |
Greetings, String parsing isn't always an easy task. Especially in cases where you need to split a single string into a great multitude, but also accounting for maximum performance. The following code presented does this task simply. Using precise allocation techniques perform greatly when writing an algorithm to precision. | |
I need to create a christmast tree which takes R value from user then output on console a Christmas tree in which last part height equals R. The tree consists of triangles of heights from 1 to n.The shape must look like (for R=4) [IMG]http://img136.imageshack.us/img136/4862/christ.jpg[/IMG] thanks in advance... | |
the question is using pointer variable: a)write a program that receives a sorted array of integer.then it will read an integer value and insert that integer value in correct place (using pointer variable) -is it how im write the code right. b)improve the first program code by allowing the program … | |
I'm scanning a file to see if user input matches a word in the txt file.. if it matches.. increase the array size and add the word. This is a 2d array. "max_word_size" is currently just a constant variable. [CODE]void UserMode(char userAnswers[][max_word_size], int *size) { FILE *fid = fopen("dict.txt","r"); char … | |
[CODE]int main() { char username[9],username1[9]; char password [5],pass[5]; int y=1,i=0; strcpy(username1,"udental"); strcpy(password,"1987"); display(); do { printf("\n\n\n\n\n\n\t\t\tPlease enter your username:"); scanf("%s",username); printf("\n\n\n\n\n\t\t\tPlease enter your password:"); //problem/probelm while((pass[i]=getch())!='\r') { printf("*"); i++; } if (strcmp(username,username1)==0 && strcmp(password,pass) == 0) { Sleep(1000); system("cls"); break; } else { printf("\n\n\t\t\t YOU HAVE MADE AN INVALID INPUT"); … | |
[CODE]#include <conio.h> #include <stdio.h> #include <windows.h> #include <string.h> #include <stdlib.h> void display(void); void menu(void); void dinfo(void); int main() { char username[9],username1[9]; char password [5],pass[5]; int y=1; strcpy(username1,"udental"); strcpy(password,"1987"); display(); do { printf("\n\n\n\n\n\n\t\t\tPlease enter your username:"); scanf("%s",username); //Right here i want to print out **** printf("\n\n\n\n\n\t\t\tPlease enter your password:"); scanf("%s",pass); if … | |
Hello, I've an external/global array that is used every where in my code.[CODE] // global.h file short is_valid[10];[/CODE] I initialize my array somewhere in the code and I want to check if everything works. When I try to print the values of the array, I get segmentation fault. [CODE] // … | |
Using the example of 10, all the numbers from 1 to 10 are initially in the game. Suppose the user chooses 9; 9 is added to his score. The Tman gets 1 and 3 since these are exact divisors of 9; the Tman’s score is now 1 + 3 = … | |
So I am trying to take my assignment and make it load an input file instead of having to input each value manually. How would I do that? Also if my program took arguments (p1a, inputfile, outputfile) how would I link that too Thanks | |
anyone knows how to use clearscreen with dev and how do you put like asterick in place of user input | |
I think I'm semi-close to a solution, but it's just not happening for me. I'm having trouble populating my dynamically allocated multidimensional array with data from a text file. Here's what I have: [CODE]#include <stdio.h> #include <stdlib.h> #define MAXLINELEN 18 FILE *getOpen(); int main() { FILE *inFile; // Declares inFile … | |
The code below compiles, runs, and gives correct results. Note, however, the commented out "Experiment" code. I want to be able to call a function which accepts a variable number of parameters, which then calls another function and passes it those parameters. How can I fix the commented-code so that … |
The End.