15,552 Topics
| |
does bool work in c(by this i mean a data type that can take only two states 0 or 1 in order to save memory)? if yes then is it included in stdio or any other file is required to be included? same doubt for c++ also mention the syntax … | |
I want to know how I can implement a function to open a file and read its contents into a linked list, and then print the contents reversed #include <stdio.h> typedef struct stack { char b[100]; int top; }stack; void push(stack *s,char k) { if(s->top==99) printf("\n Stack is full "); … | |
Hey guys i want to pick up a string from cmd . I am using C language and IDE as codeblocks. Basically i want to firstly ping an ip address and this i will be doing by simply writing "system("ping <ip address>")" . Then on console i will get the … | |
Can any one help me out to provide code for a following matrix for N numbers? 12345 21234 32123 43212 54321 Please Help me out for this matrix | |
im pay $30 to some that can finsh this for me Project #1 and #2 Specifications You are required to design a calculator. This calculator reads commands from data files called CommandsProj1.dat and CommandsProj2.dat, which I will email to you. Your program should read the commands in sequential order, process … | |
Hi Experts, I've got a school assigment in c language programming but this course is new to me. Q. Create 5 users - the 5th user would be the admin Admin would have privilledge to view user profile and disable user account. User Profile: Name, D.O.B, Gender, Occupation, Contact, Income … | |
x = constant(c)/n where x and n are variables.as n increases x decreases.initially n is taken as n1 and x1 is found out. note: n is supposed to be an integer. how can i impose the constraints of x >= 4 and x <= 14 on the above equation to … | |
Hello, I have an issue I am not sure how to handle. I am trying to call a function from within another function but I get the following warning "2129 [Warning] implicit declaration of function " I have defined prototypes for all my functions at the very start of main, … | |
Sample input: hello world a b c d Sample output: hello a world b c d Im stuck in a infinite while loop(while(j<maxStr+2)) and i need help to get out of it.Please help! Here is my code: #include "stdafx.h" #include <string.h> #define MAX_STR 5 int _tmain(int argc, _TCHAR* argv[]) { … | |
hi, [CODE] #include<stdio.h> #include<conio.h> struct cricket { char name[10]; char teamname[10]; float batavg; }c1[5]; void main() { int i,j; clrscr(); for(i=0;i<2;i++) { printf("Enter name:"); scanf("%s",c1[i].name); printf("Enter Team Name:"); scanf("%s",c1[i].teamname); printf("Enter Batting avg:"); scanf("%f",&c1[i].batavg); } for(i=0;i<2;i++) { printf("%s\n",c1[i].name); printf("%s\n",c1[i].teamname); printf("%f\n",c1[i].batavg); } getch(); } [/CODE] When i running the above program which … | |
Hello everyone! I hope that someone could help with my C assignment. The main task is to demonstrate forking, piping, message queues, signals, and shared memory with an example that a rabbit female is waiting for a rabbit boy to tell her a poem, she gives a gift in return … | |
#include <stdio.h> #include <stdlib.h> #include <string.h> #define FILE_NAME 20 #define LIST_SIZE 50 typedef struct { char *name; int score; }RECORD; float calMean(RECORD list[], int count); void sortData(RECORD list[], int count); int main (void) { // Declarations float mean; float median; FILE *fp; char fileName[FILE_NAME]; RECORD list[LIST_SIZE]; char buffer[100]; int count … | |
can someone help me with the development of a hook and jeeves pattern search optimisation in c programming with graphical visualisation in step wise. a function bhp is to be minimised by effective selection of 2 parameters x1 and x2 while bhp has been passed x1 ans x2 as arguments … | |
#include<stdio.h> #include<time.h> #include<conio.h> #include<string.h> #include<math.h> #include<stdlib.h> int p,q,r; int i,t[100],t1[100],t2[100]; char M[100],C[100]; int phi,n,e=53,d=11; int cipher(int t) { int i,temp; temp = 1; for(i=0;i< e;i++) temp = temp * t % n; temp = temp % n; return temp; } int plain(int t) { int temp,i; temp = 1; for(i=0; … | |
#include <stdio.h> #include <stdlib.h> #include <string.h> #define FILE_NAME 20 #define LIST_SIZE 50 float calMean(RECORD list[].score, int count); typedef struct { char *name; int score; }RECORD; int main (void) { // Declarations float mean; FILE *fp; char fileName[FILE_NAME]; RECORD list[LIST_SIZE]; char buffer[100]; int count = 0; int i; // Statements printf("Enter … | |
Hello, in my game I am wanting to move my character and shoot a projectile simultaneously, but I need the projectile to emit from the character. Thus I am using the same variable for starting positions of character and projectile. When I shoot projectile, it goes from player to wall, … | |
what is the meaning of `fseek(file, -4, SEEK_CUR);` | |
Hi, I have some questions about type check warning. I am reading the tutorial notes from [Click Here](www.clear.rice.edu/comp221/html/pdf/03-arrays-pointers.pdf) CASE 1 int int1 = 1036; /* some data to point to */ int int2 = 8; int *int_ptr1 = &int1; /* get addresses of data */ int *int_ptr2 = &int2; *int_ptr1 … | |
| I'm not sure if I'm freeing the memory correctly. I have the following struct and I'm trying to free the pointer in it. typedef struct RECORD { char* name; int score; }RECORD; In my main function I have an array of this struct, therefore I'm using a loop to free … |
I have this code: #include <stdio.h> int create_logfile(char *name, char *field, char *joindate) { FILE *ofile; ofile = fopen("test.txt", "a+"); if(ofile == NULL) return 1; fprintf(ofile, "%s\t%s\t[%s]\n", name, field, joindate); fclose(ofile); return 0; } int main() { char name[100], field[100], joindate[100]; printf("Name: "); fgets(name, sizeof(name), stdin); printf("Field: "); fgets(field, sizeof(field), … | |
Hello everyone, I'm trying to implement qsort on a struct with the double as a pivot: typedef struct{ char sequence[9]; int occurance; double prob; }tuple; ...... int compare (const void *x, const void *y){ if (x < y) return -1; if (x > y) return 1; else return 0; } … | |
// i want create doubly linked list in c with following choices: 1- add to head 2-add to mid 3-add to tail 4- delete from head 5-delete from middle 6-delete from tail 7- search 8- print 9- exit i write my program but founded some errors what is it? [CODE]#include<stdio.h> … | |
Design a word and character counter and display a histogram of particular characters. The histogram may use any character to denote a single instance of a particular letter, such as an X, and should print the number of instances for that letter at the end of the line. Only print … | |
I cant find the error here... its giving 0 0 as output for all input cases. plz help. #include<stdio.h> #define max(a,b) a>b?a:b void build(int ai,int l,int r); int query(int ai,int l,int r,int i,int j,int count); void update(int ai,int l,int r,int i,int j); int aa,b,m; int inp[6]; struct arr { int … | |
Dear all, I am studying about Information Technoloy at HCMUS. Through 3 years, I never see that prototype of this function. static void FUNCTION(fft_halfcomplex,pass_4) (const BASE in[], const size_t istride, BASE out[], const size_t ostride, const size_t product, const size_t n, const TYPE(gsl_complex) twiddle1[], const TYPE(gsl_complex) twiddle2[], const TYPE(gsl_complex) twiddle3[]) … | |
how do you do unbuffered io in c? I need to write each charachter typed to a socket, not waiting for "\n" newline i.e. enter key any help? | |
i want to do topo sort but i want to output the lexographically smallest topo sort vesion of that. http://www.spoj.com/problems/TOPOSORT/ here goes the link of problem. actually, i have done this using DFS , but i am able to do the question "print any possible topo sort" of the graph. … | |
I have a program like this: int main () { int * buffer1; buffer1 = (int*) malloc (100*sizeof(int)); buffer1 = buffer1 + 5; free (buffer1); return 0; } So my doubt: How much int-sized memory will this free-function free. 100 or 95 ? | |
#include<stdio.h> int i=5; main() { int i=6; { int i=7; printf("%d",i); } printf("%d",i); } Why does the above code doesnot give a variable redifinition error..Although the variable i is defined outside of block also?? | |
Ok, so I attempted using a struct to animate my character, since my original hard coding produced poor performance. Here is my code: //struct template for animating character movement struct animate { int draws; int animationFrames; char *frames[TOTAL_FRAMES]; int charWidth; int charHeight; int xCoord; int yCoord; int xMove; int yMove; … |
The End.