15,552 Topics
| |
Hi all. First post on the forum. I'm writing a generic funtion to open files along my program, but am worried if the pointers are being closed correctly. The function definition: [code=c] FILE* openfile(char *FileName, char *Mode) { FILE *TempFile; if((TempFile = fopen(FileName, Modo)) == NULL) { fprintf(stderr, "Couldn't open … | |
Write a function that reads an integer n and several lines of text (sentences between 150 – 200 characters). The text will be printed n characters per line, by adding extra spaces as evenly as possible. For example: Enter an integer (maximal number of chars per line): 10 Enter some … | |
Well, here i am one more time. In previos post I asked here about read files. All of those problem were fixed, but now, i really have a problem that I don't know why is happing. In the first , i need to explain what my system will do: My … | |
ok so i am making a program that has a master slave process. the master sends out the 2-d array which is 1000 by 1000 to the slaves. then the slaves calculate the sums of the rows sends back to the master who sums it all up. then the time … | |
I have this C program with multiple files and I want to introduce a new file called enemy.c. and I'm wondering if I'm going about this right. game.h [code] #ifndef GAME_ #define GAME_ extern void game (void); extern void enemyFunc (void); extern int enemyPosX; #endif [/code] main.c [code]int main (void) … | |
Hi I am making an mp3 database at the moment and i have run into some difficulty when passing down the array to a function. I can do it when i create the array globally as obviously this means i dont have to pass it down, but i want to … | |
Hi, I'm trying to create a simple distributed system model in C where a central controller regulates the communication between several machines. The controller's job is firstly spawning client process in several hosts. In my understanding to do this you needs to have a connection with the target host but … | |
Can anyone shoe me an example code to encode an entered password in C. for example: password=vista when displayed to the user on screen when entering the password it should look like this ***** Can someone show me how this can be done, thanks | |
Hi guy, i have this little program: [CODE] #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h> #include <unistd.h> //Obtem o nome do buffer de trade baseado na hora char *btfile() { char *fname; fname = malloc(14); time_t t = time(NULL); struct tm *lt; lt = localtime(&t); strftime(fname, 14, "%m%d%H%M.tbf", lt); … | |
Hi Everyone, I'm really fed up of working on C in Windows Vista. First and foremost, the window of C occupies only half the screen which is very annoying. I've heard that there is a distinct C that is used with Vista but I have failed to attain any more … | |
Can someone please tell me what im doing wrong in this program..im gettin a compiler error saying: C:\Dev-Cpp\projects\proto.cpp In function `int main(int, char**)': 46 C:\Dev-Cpp\projects\proto.cpp a function-definition is not allowed here before '{' token 46 C:\Dev-Cpp\projects\proto.cpp expected `,' or `;' before '{' token C:\Dev-Cpp\projects\Makefile.win [Build Error] [proto.o] Error 1 The … | |
hi every body....... here i want to ask something about base64 algorithm which is used for the encryption of passwords.........i just want to know that how it works ?????what are the functions used in this algorithm?????any type help.....any link...???? | |
hey guys... Thanks for your help in my previous post. Havin another problem in my stack assignment this time.. Have done how much i could but there is a lil error in it.. Possible in the [B]convertip[/B] function... Hope i can get the help needed.. Thanks in advance...=) [CODE]#include <stdio.h> … | |
I've been trying to read all I can about the %n conversion specifier, but I'm having trouble with it. In the following code, I generate ten random numbers between 1 - 1000 and save each to an element of the array. I need to use %n to keep a running … | |
[CODE]#include<stdio.h> #include<conio.h> void** printA( int* , int ,int[][]); void printw(void*, int ,int); void main() { int num[3][5] = { {1, 2,3,4,5}, {6,7,8,9,10}, {11,12,13,14,15}, }; int* num_ptr[3]; void** ptr; printf("traversing by double pointer"); ptr=printA(*num_ptr,3, num); printw(* ptr, 3, 5); } void** printA(int* num_ptr[],int r,int num) { int i,j; for(i=0;i<r;i++) { *num_ptr[i]=num[i][0]; … | |
Hi! I need help to my Turbo C program.. I need to create a program that will ask the "Starting X:", "Starting Y:", Ending X:", and Ending Y:" on different shapes.. this is how the program should be: [CODE]SQUARE: starting X: starting Y: ending X: ending Y: CIRCLE: Starting X: … | |
Hi, i have this letters, A,R,V,G,M,N,B. And from those i need to get 4 of them randomly, bit i dont know how to do it, please help! :D | |
hi guys, i'm frustrated at my piece of code for a heap sort function. i believe everything is correct but i am a hardcore beginner at c. i have made a rand.txt file with some floats in it in the form; 91.175598 68.562500 96.664803 29.593500 43.156502 34.241001 59.178200 85.542702 81.852798 … | |
I should do programme in C , but I don 't know witch struct I can use.:( question : we have congresse , where there is 2 type of activities : activity 1 and activity 2 in each one there is many activities where many people are linked in :( … | |
I have created a icmp ping function but it doesn't always work due to the firewall of the computer I am trying to ping. I heard you can get around this using a tcp ping. How can i construct a tcp ping packet. I did a little research and it … | |
[CODE] scanf("%[^\n]",line); [/CODE] tell me the logic of this scanf statement and why " [^\n] " is used instead of %s ... and how this statement works... i know that this statement inputs lines till enter is pressed.. but what is the format of the scanf statements please tell.. | |
Hey Guys, So I am working on a program in class that asks for the age of your dog and translates it into human years....needless to say overly easy and boring. So I want to get into adding sprites to C. My first question is where I can find some … | |
I am not sure what this means and I get it all the time. Can someone help me fix this code? [ char add_account(account_t a[]) 7 { 8 int i, N=1000000; 9 char ch; 10 char str1, str2; 11 int m=20; 12 13 for(i=0;i<N;i++) 14 { 15 if(a[i].number==0) 16 { … | |
Hello, and thanks in advance for any help I can get. This is part of a larger program for homework. Things were working when I called "addVacantStore" the first time before I wrote the search function. I then called it twice more to set up to test the search function. … | |
Hi, I have written a program just to check the behaviour of the compiler. i expected an error in function call statement. but its not generating any error. the declaration of function we include to check the type of args and no of args and return value of function. but … | |
I am brand new to all this and I can't get my program to read the file from input. Here is my code. It says segmentation fault (core dumped) I'm assuming because fp is not getting the file information. Can anyone help? [code]#include <stdio.h> #include <ctype.h> #include <stdlib.h> #define getchar() … | |
Exercise 1-18. Write a program to remove trailing blanks and tabs from each line of input, and to delete entirely blank lines. I have no idea about this program . 1. first tell me the meaning and what to do in this question? 2. second provide me the source code … | |
[CODE]#include<stdio.h> #include"graphics.h" #include<stdlib.h> #include<conio.h> void main() { int graphdriver=DETECT,graphmode; int color,n,m; initgraph(&graphdriver,&graphmode); for(n=0;n<10;n++) { putpixel(250+n,350,BLUE); } for(m=0;m<10;m++) { int x=getpixel(250+m,350); printf("%d",x); } getch(); } [/CODE] I have to compile programs using graphics.h but i use Microsoft visual studio 6.0 . There is no graphics.h file in it... so i copied … | |
Hi! I need help to my Turbo C program.. I need to create a program that will ask the "Starting X:", "Starting Y:", Ending X:", and Ending Y:" on different shapes.. this is how the program should be: [CODE]SQUARE: starting X: starting Y: ending X: ending Y: CIRCLE: Starting X: … | |
[CODE]#include<stdio.h> #include<string.h> int main() { int i,x; char c[100]; printf("Enter input :"); fgets(c,100,stdin); for( i = 0 ; i <= (x = (strlen(c))) ; i++) { if( c[i] = '\t') { c[i] = (' '); printf(" "); } printf("%c",c[i]); } }[/CODE] the aim of this program is that it will … |
The End.