19,876 Topics
![]() | |
I have a program, my own shell where the first input is command and the 2nd is cmd. Im trying to get cd working but having trouble with chdir function, i have this and it just gives me a segmentation fault and i dont understand why. [code] while(!strcmp(command,"cd")) // while … | |
Hello all I am currently coding a starter multi threading program in c. It is supposed to find all the prime numbers from 2 to n. I have no previous experience in thread coding so I am looking for some help and maybe some debugging advise It only calculates primes … | |
I am tring to get this program together and can't seem to make it work. Ok. . this program is to take in a file with a matrix of zeros and numbers 1-9. The zeros are shaded and the numbers are part of a block. All numbers and the ones … | |
I have a client/server socket program example that I am modifying in order to pass a parameter to a called program on the server side. The problem that I’m encountering is trying to build a command line string that will execute the called program from a “system()” function. I’m testing … | |
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 … | |
Hi fellow forumers...I am new to this forum and programming. Regarding the above topic..Is there and code that solves this sort of question? My question:A program that input 10 integers and find the largest value. Thanks very much! | |
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, … | |
C++ program creating array the uses the dot product? normalized dot product // Matches the Signal with the Pattern Signal using the "dot product" // of Signal and Pattern divided by the square root of the energy of each. // According to the Cauchy-Schwartz inequality, the result will be // … | |
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 … | |
Hello i'm having trouble reading from files from fstream. I want to skip a word but don't know how to do so with input from files. [code] myfile >> avatar.name >> avatar.name >> avatar.name; myfile >> avatar.hp >> avatar.hp >> avatar.hp; myfile >> avatar.mana >> avatar.mana >> avatar.mana; myfile >> … | |
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 … | |
I'm going to build a text editor in Turbo C++ 3.0 , but i don't know how a text editor works . I want to know the working of text editor , any tutorials ? Please help | |
Hi there guys thanks for you help. Basically I have created a c# form based rot13 encryption program. The problem I am having is implementing these into a class with methods which can be accessed from the from. In the main from I have a textbox called message textbox I … | |
Hello to every one, I am writing a simple web browser on c# 2008 express edition using WPF. It is working fine with www websites and display all content correctly. But if I want to open some local webpage - for instance "file://C:1/1.htm", it is save the webpage instead of … | |
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 … | |
May I know use of Method returning a pointer in C++, please? Thanks. | |
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 |
The End.