15,539 Topics
|
|
[CODE]int sin2(int g) { static int metritis1=1,i=0; int l,c,pin[100],pin2[100]; char result; srand ( time(NULL) ); l = rand() % 10; c = rand() % 10; c=65+c; l=l+1; pin[g]=c; pin2[g]=l; printf("%d and %d the g is %d\n",pin[g],pin2[g],g); while (1){ if (pin[i]==pin[g] && pin2[i]==pin2[g]){ printf("%c kai %d g is %d to i … |
|
Efficient code for extracting unique elements from sorted array. Time Complexity is O(n) |
|
Thanks in advance for any help I can get. This is a que I need to add in to another program. It is almost straight out of the book, and a lot like my working stack implementation. It steps through correctly when I go line by line, but I'm not … |
|
char *default message[]="hghgghjgh" char *message=defaultmessage tis line showing error as 'initializing':cannot convert from 'const char[ 9] to 'char *[]' can u help me....? |
|
Hi.I write a program in C for my microcontroller(PIC 18F452) but faced to a problem that related only to C language and that is; as you can see in my Main program and the two Functions I want to pass an array of ; " int adcvalmax[8] " which got … |
|
Hi , I am preparing a project in C using mouse handling. I have no idea as to how input(text) taken by user in a graphics mode. Kindly help |
|
Hi, i have written a program to find the power of two numbers using iteration. The problem here is that to return the correct out put for even powers but not for odd powers. b = base , e = expo ,p= power( b, e);; for even powers the statements … |
|
[CODE]#include <stdio.h> #include <stdlib.h> typedef struct { int finalMark; /* Ï ãåíéêüò âáèìüò ãéá çï ìÜèçìá */ }StudentType; struct var { StudentType *aStudent; char onomaa[20]; char eponimoa[20]; }; typedef struct var newtype; newtype a; main() { int bathmos; char onoma[20]; scanf("%s",&onoma); strcpy(a.onomaa,onoma); printf("%s",a.onomaa); system("pause"); scanf("%d",bathmos); strcpy(a.aStudent->finalMark,bathmos); printf("%d",a.aStudent->finalMark); system("pause"); }[/CODE] this … |
|
I have to write a program where the producer gets the some number of inputs from the user and the consumer takes from the shared memory and prints their squares.In my program i have the shared memory size as 5. my program works perfectly in the area that producer and … |
|
I'm writing a program of Conway's Game of Life. I think I've figured out most of it but there something wrong with the rules I've set up [CODE=c]for(row=0;row<20;row++) { for(col=0;col<21;col++) { n=0; if (a[row][col]=='*') { if(a[row-1][col-1]=='*') { n++; } if(a[row-1][col]=='*') { n++; } if(a[row-1][col+1]=='*') { n++; } if(a[row][col-1]=='*') { n++; … |
|
Hello, As of right now I'm in a hard spot. You see at this moment, I've been programming both my client and server. And everything was working very well, until I realized something. The fact that in my client I have multiple threads running and sending data to my server … |
|
I didn't know where to put this but this seemed to be the best place. I took an internship this summer and found out that I will be doing embedded development in C/C++ and Linux for phones(land line voip stuff). This is bad for me since I have always been … |
|
I am trying to create a program that reads a data file and computes the water usage for each hour of the day, the average hourly usage for the day, and the time of the highest hourly usage. I already created the main program, and two other functions, along with … |
|
Hello. I would very much appreciate if someone would aid me with a hint. My problem is as follows : read two arrays of chars and merge them into a third array like so : ARR1 :123abc ARR2: rt678iogl ARR3:1r2t36a7b8ciogl The problem must be solved without pointers and string.h Basically … |
|
Hi, [CODE] #include<stdio.h> int main( void ) { float a = 0.2; if( a > 0.2 ) printf( "\n a is greater than 0.2" ); else if( a < 0.2 ) printf( "\n a is less than 0.2" ); else printf( "\n a is equal to 0.2" ); return 0; … |
|
Hi I want c language code to open my web browser (IE or Firefox) and close it after 2 min. can any one help me?? please i need it. |
|
I have a question, well more of a verification. In the program below, I'm packing a character array with some values. The first two are unsigned integers the next is a function pointer and the final is a string of characters...Now my question, is the casting correct for the function … |
|
[CODE] /* ** showip.c -- show IP addresses for a host given on the command line */ #include <stdio.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #include <arpa/inet.h> int main(int argc, char *argv[]) { struct addrinfo hints, *res, *p; int status; char ipstr[INET6_ADDRSTRLEN]; if (argc != 2) { fprintf(stderr,"usage: … |
|
Hello, this forum is for asking the required code and logic behind implementing the "factorial program - i.e. finding factorial of any big number"---could someone help me out???/ |
|
Hello people, i'm new here, and i hope that you can give me a hand with a little client-server software that i'm doing that it's driving me nuts. The essence of the program is very simple, you have this client (in my case cliente.c, as i'm Spanish) with this syntax … |
|
I'd like to write a function in C that takes the current system date adds a user defined number of days and returns the new date. Im new to C so Id like any suggestions . Thanks in Advance. |
|
I'm trying to repair a program that computes averages of several values inputted by the user. All values are scanned on one line and taken as an array. My program is nowhere near complete and I'm trying to fix it up little by little. The one part that I am … |
|
Hi! Can any c programmers there help me with this assignment please? I really do not get my lecturer. Conway's [I]life[/I] is a special kind of game. It isn't really a game - just a spectator sport. It is played on a chess board, where each cell is either alive … |
|
Hmm, I was trying to load strings from a file(formated) to an 2D Array... but.... [CODE] FILE * fp; char TempBuffer[100][100]; char array_game[100][100]; fp=fopen(filename,"r"); for(i=0; i<100; i++) // Create 2D array to Hold the array of the file { for(j=0; j<100; j++) { fgets(TempBuffer,101,fp); strcpy(&array_game[i][j],TempBuffer); } } [/CODE] I get … |
|
[CODE]#include <stdlib.h> #include <stdio.h> #include <time.h> #define MAX_ROWS 10 #define MAX_COLS 10 static char map[10][10]; void sin1(char map[][MAX_COLS]); void sin2(void); void sin3(char map[][MAX_COLS]); int main(void) { system("chcp 1253 >nul "); FILE *fileptr; char myColchar,apantisi,map[MAX_ROWS][MAX_COLS]; int metritis1=0,apotelesma,myColnum=1,myrow=1,k,a,l,c,row, col; char r,fileRow[MAX_COLS + 2]; // account for newline and NULL printf("dose tin diataksi … |
|
I have a project which is to design a came called Miensfeld. In Miensfeld, the player, Timmy, is located on one side of a 8 by 10 cell area minefield. My task is to move Timmy safely through the minefield to get to the other side, earning points as he … |
|
I have to read from input file (which contains strings and integers) only integers, rearrange them to descending order and write to output file. How should I do this? |
|
Please suggest me some tutorials on Windows programming in C with detailed review on windows registry and header files like #include<windows.h> #include<functions.h> #include<fstream> #include<dos.h> etc... |
|
I need to get character input from the user and convert it into a float type. However, I can't use arrays, strings or the functions printf() and scanf(). I have to do everything with putchar() and getchar(). How would I do this? |
|
hi guys, here's my code im having a hard time on how to edit. i can add and view it yet unable to edit it. thanks! [code]/* * dental.c * * Created on: 30/04/2010 * Author: danovert */ #include<stdio.h> #include <string.h> #include <conio.h> #include <stdlib.h> typedef struct { char fname[30]; … |
The End.