15,551 Topics
| |
hi there everybody, i want to include exe files through file handling commands.how can i do this? regards monto | |
I have some problems: - How can I erase a file? - How can I create a random string has 8 letters? This is my code to create a random string has 8 letters: [CODE] char *b=""; int i,j; FILE *f=fopen(file,"w"); for(i=0;i<4;i++) { for(j=0;j<7;j++) *b+=char(random(27)+65); fprintf(f,"%s\n",&b); } fclose(f); [/CODE] But … | |
EDIT: Please note, this assignment was already submitted. Well for our assignment this time around, we had to write up a BASIC editor. It had to sort lines of code numerically. Each line would never be more than 80 characters long and there would never be more than 100 lines. … | |
unsigned int is 4 bytes in the system i'm programming. i printed sizeof(unsigned int) and it said 4. [code] int main(int argc, char * argv[]) { unsigned int a = 0; long int b = 2607503366; /* the b data type must strictly be a long int */ a = … | |
[code] unsigned int nBolum = 0; unsigned long nKalan = 0L; unsigned long ulA = 0L; unsigned long ulB = 0L; ... printf("ulA=%u\n",ulA); printf("ulB=%u\n",ulB); nBolum = (unsigned int) ulA/ulB; nKalan = (unsigned long) (ulA%ulB); printf("nBolum = %u\n",nBolum); printf("nKalan = %u\n",nKalan); ... [/code] it prints; [code] ulA=2607503366 ulB=16777215 nBolum = 155 … | |
[code] unsigned long nBolum = 0L; unsigned long nKalan = 0L; unsigned long ulA = 0L; unsigned long ulB = 0L; ... printf("ulA=%u\n",ulA); printf("ulB=%u\n",ulB); nBolum = (unsigned long) ulA/ulB; nKalan = (unsigned long) ulA%ulB; printf("nBolum = %u\n",nBolum); printf("nKalan = %u\n",nKalan); printf("HVFE.c exiting\n"); exit(1); [/code] it prints : [code] ulA=2607503366 ulB=16777215 … | |
I have a file of 14 functions. I know I need an extern array of 14 bools. If something goes wrong in one of these functions, the function should modify its respective array member to false. I want the main program to be able to access the array members to … | |
i have the following struct [code] typedef char * typos_stoixeiou; typedef int metritis; typedef struct korifi *kdiktis ; struct korifi { typos_stoixeiou dedomena; metritis counter; int kleidi; int arithmospaidiwn ; korifi *a[100]; }; [/code] if i try this [code] for(int s=0;s<size;s++) { root->a[s] = (kdiktis)malloc(sizeof(struct korifi)); root->a[s] = NULL; }[/code] … | |
I need to write wrapper functions for fork and signal functions. These functions will handle errors by fork() and signal() and exit, if an error occurs. The problem is I am not sure exactly what to check for on either function. Here is some sample code for both of them. … | |
I am writing a server function and an error message is defined as: [code] #define UNKNOWN "Unknown" [/code] I have a function: [code] void search(int sockfd) { FILE *file; char arg1[MAXLINE], arg2[MAXLINE], title[MAXLINE], line[MAXLINE]; file = Fopen (PATH, "r"); while (true) { if (Readline(sockfd, title, MAXLINE) == 0) return; Fgets … | |
hello. i'm new here and new to C programming so would appreciate any help with a problem i have. how can i copy the contents of a command line argument e.g. argv[1] to a string declared within main() e.g. filename[30] cheers..... PS this isn'y my homework:lol: | |
Hello I am having no problem while returning 1 dimensinal array But am having trouble with 3 dimenional array No problem with this code [CODE]float Mat[][][]; float Mat[]; float *funct1(void) { return Mat; } void funct2() { float *Mat; Mat=funct1(); } [/CODE] But this doesnt work [CODE] float Mat[][][]; float … | |
Can anybody give me the source code of ANY of the following programs.... me newbie to C.... 1. Write a program which takes 10 numbers as INPUT and tell which one is GREATER. 2. Write a program which takes 10 numbers as INPUT and tell which one is SMALLER. | |
Please help me to resolve my problem. How to print a set of character in bold form in "c" or "c++" language. | |
can ayone share his knowledge related with hardawre and networking with me so that i earn my livelyhood from the start and in return ill pray from THE ALMIGHTY for increase his knowledge! thanks | |
hey all i have a real problem with fibonacci numbers i have calculated max fib(47) with my codes but i have a project that i need to calculate the n'th fib number which is get from the user and print the fib valu to the screen the numbers must be … | |
I keep getting this warning every time I compile the following code. Can anyone please tell me what I am doing wrong. Also, the printf(head->data) keeps saying that printf's argument is invalid. How do I print head's data? Any help is appreciated. Thanks, [CODE]#include<stdio.h> #include<malloc.h> typedef struct { int data; … | |
i had a prob wen i had to sort each column of a matrix. the prob s wen i use larger values say 2453,23465 etc. the sorted matrix returned garbage values.. y s that? n how do i find factorial for 300 n bigger numbers?? i'm not able to store … | |
hi, i want to begin socket programming and interprocess communication but i don't where to begin....can anyone suggest some sources?? thanks in advance, nicolas PS:: sorry if the question is vague, but it isn't easy to be more specific.... | |
How do i write a programm that the given text.the longer the text will factorized (in primenumber order).The text is for the following transformation as matrix with the Dimention [B]n[/B](breath;smaller Primefactor) multiply [B]m[/B](highest;bigger Primefactor).The letters of this matrix will in column by column displayed the output format is the transpose … | |
I made a program in C for my school work but i cant make it work.Piglatin means cutting the first character of a word and adding it to the end and finally adding an "a" to the end.For example teacher -> eacherta. Can you help me finding the problem? [code=c]/***************************************************************************************/ … | |
I want to pass a float array from one function to another function I want to make use of the float array type(here container) [CODE]void funct1() { float container[4]={0.1,0.2,0.3,0.4} void funct2() ----(1) {return container;} } void funct3() { void funct2(); use container array; }[/CODE] Here what would be the funct2() … | |
hi I use Turbo C compiler in my school (Gujarat, India) Our course based on book E.balagurusamy there is no description of array like this int a[3,2] can ne 1 plz tell me how it is different from normal 1d array ? n how d values r stored in that … | |
Hello! I'm practising 2d-arrays for my upcoming test so pls help! i cant figure out what went wrong :((((( Q: A factory has 3 divisions and stocks 4 products. An inventory data is updated for each division and for each product as they are received. The current inventory data is … | |
Hello. Here's my structure: [code=C] struct settings { char setting[40][255]; }; [/code] Here's the function that is supposed to take a pointer to an instance of the above structure and modify it : [code=C] void changeSetting(struct settings *tempSettings, char *newValue, int indexValue) { if( indexValue<40){ // to avoid out of … | |
I have small question: How can I create a random string from 'a' to 'z'? thank you! | |
Hello can some one say how to use tracing in turbo c and to show the trace like we do manully is their any function how do watch options work plz say me i am a student and beginner in c guys help me experts professional and any one plz | |
Hi could you please tell me how to print array elements with spaces. Please provide an example. I would like to see how a 2 D array is printed.Thanks a lot | |
For an assignment that im working on, we needed to accomplish the following: Asks the user for their name, accepts and stores the answer as a string. Opens a text file: questions.txt for reading �Opens a text file: studentName.ans for writing, where studentName is the one entered Reads each line … | |
I am trying to write a program that has to create a structure that has one variable called value and one pointer to the list(making it a linked list). It need to prompt the user for 5 values and store them into the linked list, then print out the list. … |
The End.