15,551 Topics
| |
I am trying to try search a file for a record based on on a number is enter which is printed to a file under registratation number.I just want to know if my coding is correct.Below is a sample of the module. [CODE]{ struct custinfo info; FILE *customer; char number[5]; … | |
Thanks for all the help so far but i am writing to a file numbers from as string and i am getting incorrect results.how may i correct this | |
Hi there folks, I got some minor problem with this code: [CODE] #include <stdio.h> #include <stdlib.h> int main(){ char option, factor; printf("Choose your operator: \"+\" ; \"-\" ; \"*\" ; \"/\" \n>\t"); scanf(" %c", &option); printf("You chose : %c \nChoose your factor:\n>\t", option); scanf("%d", &factor); printf("You chose : %i\n",factor); printf(" … | |
Can anyone tells me that strstr can use to search a record with typedef struct{}??? I was just asking... and if its true then can i know how?? im just a beginner with a great project from our instructor T_T,.,.,,..,., | |
Here's the thing I want to compile this program in c using the GUI environment, but it isn't working out. I know that you can make a new project with windows32 GUI but it still isn't 'getting' the custom library. Am I missing something like linking the library somewhere else? … | |
Hey I wanted to know how to make a number pyramid with (for example) the following formation: (This would be for 5 rows, with 5 being a variable and as you can see in the last row the last number is 5 on each end) [IMG]http://img199.imageshack.us/img199/2239/numbers.png[/IMG] [url]http://img199.imageshack.us/img199/2239/numbers.png[/url] So far I … | |
I am currently working on a program that inputs a line from a file, then reads the vowels in the file, next I am going to count the number of letter a within the program. Below is the program I have done but it is not working. It opens the … | |
Hey, I have a problem. I want that when the user presses the ESC Key, my program will send him a message if he sure he wants to exit the program. [b]Basicaly what I need help with is how to do the "IF Esc is pressed"[/b] Thanks | |
I just received the MERGE SORT code from my friend, here it is [CODE]void sort_merge (int *array, int low, int high) { int mid; if (low < high) { mid = (low + high) / 2; sort_merge (array, low, mid); sort_merge (array, mid + 1, high); array_merge (array, low, high, … | |
I am sick of segmentation faults. This is the last straw. How to tame this ferocious wild beast? For small programs it can be debugged. But when dealing with large programs such as implementing a b-tree with thousands of pointers it is a nightmare to pinpoint the location of segmentation … | |
Hi, If suppose we have a double pointer like char **a and for each a[i] we allocate some space also, then is it sufficient to free a only or we need to first delete each a[i] and then delete a? And if there are parent child relationship like a is … | |
Hi, I would like to declare function with calling convention. But getting following errors on CentOS 4.7 with GCC 3.4.6 test.c:3: error: syntax error before "display" test.c:3: warning: data definition has no type or storage class test.c:12: error: conflicting types for 'display' test.c:3: error: previous declaration of 'display' was here … | |
I have been learning c++ and Allegro (graphics libary) for about a year, and have been trying to get this code to work (in particular, passing the array of classes), and when compiling i get the following errors C:\Documents and Settings\User\Desktop\npc.h In member function `void cNPC::NPCmove(cNPC*)': 96 C:\Documents and Settings\npc.h … | |
Hi could someone please help me with this problem. I want to find the greatest and least numbers of all current input numbers. My output is wrong. I can't seem to calculate the max/min of all the current input numbers. My code only find the max/min between two inputs. Here … | |
Hello, I have observed a data access misaligned address violation during the following data type casting. [code=c] #include <stdio.h> #include <stdlib.h> int main(void) { float mul[19013]; unsigned int ch_sz=76052, i; mul[0]=0; for(i=1; i<(ch_sz/4); i++) { mul[i]=mul[i-1]+(1/(float)(ch_sz/4)); printf("%f\t", mul[i]); } return 0; } [/code] Please help me isolate the issue and … | |
I have written a program for the Game of Life in OpenMP with C. But the execution time is increasing with the number of threads. Can you please help me with where I am wrong? [CODE]#include<stdio.h> #include<stdlib.h> #include <malloc.h> #include <math.h> #include <sys/time.h> #include<omp.h> #define ALIVE 1 #define DEAD 0 … | |
i want to write a program using "for" loop, that will generate the following output. value of a is 0, value of b is 2 value of a is 0, value of b is 4 value of a is 0, value of b is 6 value of a is 1, … | |
Hello everyone i am new in C language and need some basic help. see this program, [CODE] void main(void) { int a,b; clrscr (); { for (a=1;a<5;a++) { for (b=2;b<6;b++) { printf ("value of a is %d , value of b is %d \n",a,b); b=a+1; a=a++; } } } getch(); … | |
Hello, I am trying to create a doubly linked list that will print the entered input in the original order and then print it in the reverse order. Earlier I was able to get it to print the list twice, but the second time was not in the reverse order. … | |
I am trying to find the value of a given base and exponent, with the exponent being an integer greater or equal to 0. However, I am getting strange numbers at output. Could someone please take a look at my code ? [CODE]/* File: driver3.c * Date: February 28, 2010 … | |
I'm writing a c code, we can include mqueue.h and write the function mq_open with the arguments, but it won't build. I know it's a problem with the linking, I need to add -l libname or something to the linker. But I don't know what to write there and how … | |
Hi, I have global and local variable with same name, and I would like to access global variable. But I am getting this error: "error: syntax error before ':' token" . I have GCC 3.4.6 on CentOS 4.7 #include <stdio.h> int amount=20; int main() { int amount=10; int k = … | |
I'm writing a library system and need to search for a book entered in the system to renew it. But my search refuses to work Code void search(){ // function to locate a record int barc; char search_aulname[28],search_aufname[28],search_stufname[28],search_stulname[28],searchbk_title[500]; char aulastname[28],aufirstname[28],stufirstname[28],stulastname[28],bktitle[500],date[120],genre[28]; FILE*fp; system("cls"); printf("*****************************************\n"); printf("ENTER AUTHOR LAST NAME OF ITEM:\n"); fgets(search_aulname,28,stdin); … | |
Can anyone tell me what this means and how to fix it? I keep getting this warning, the title of this post, and I'm not quite sure on how to fix it. It is messing up what I'm trying to do. Here's the code: [CODE]#include <stdio.h> #include <stdlib.h> #define MAXLINELEN … | |
hey guys i need some help with cell be programming.Pls msg me if u knw anything abt it | |
Hello Everyone I have just started studying about applications and usage of DBus and as I able to understand that it is possible to pass messages between two different applications(programs) written in different languages usnig DBus. But I am not able to implement it. So just for demo, I want … | |
i have a question about the logic about the calendar question. I have to make a calendar, so user inputs a month (number 1-12) and a date, and the output is suppose to be: Friday, January 1, 2010. Suppose to be written in just simple c, no arrays or anything, … | |
This is homework, but I'm stumped on this problem. It prints store->storeId properly in "case 0", but storeId prints with the name added in the "printMall" function, i.e. "L01vacant" it then prints "vacant" for store->store name as it should and the rest of the printMall function prints properly. I've changed … | |
Hello oh helping minds I have a dilema...I've got to create a C language address book and not C++ or turbo C...I've already done a majority so far but I need help with a certain problem if there are any other problems please let me know. I keep getting an … |
The End.