15,551 Topics
| |
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]; … | |
[code]#include <stdio.h> char *matriz; char n; int cuad; void guardarValor(lin, col, valor) { int pos = ((lin-1)*n) + (col-1); matriz[pos] = valor; } void imprimeMatriz() { int cont; for(cont=1;cont<=cuad;cont++) { printf("%d\t",matriz[cont-1]); if ( cont%n == 0 ) printf("\n"); } } int main() { int cont, posL, posC; n = 5; … | |
I posted a couple of days ago about this subject but I have a more specific question about programming with music in c. My main question is that are the ID3v1/ID3v2 tags universal for ALL music files or are there a specific tags I should be checking for, for a … | |
Hello, could someone help me create a program that will take in separate strings from a user and then output it all on one line in random order? This is what i have so far: [CODE] #include <stdio.h> #include <string.h> #include <stdlib.h> int compareStrings(const void *pStr1, const void *pStr2) { … | |
Hey i got the same error in my code and as discussed i cant rectify it after changing the u value. The error is on a linux machine. The program checks if a no is prime or not. [CODE] #include<stdio.h> int primality(int n) { int i; char ch='y'; for(i=2;i<n;i++) { … | |
Hi all, I'm pretty new to C, so apologies in advance, I am trying to write code that will allow me to input a line no and then display the text from that line from the corresponding file. I'm having a bit of a brain fart & can't work it … | |
Hey all this code should read in info and store it to a file. Then retrieve the file and calculate the sum and average of the row and column. But for reason I keep getting rubbish for my sum and average output. can someone look at it and tell what … | |
hello everyone, i need to modify these code: [code=c]#include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int numOfStars = 0; int count, counter; do { printf("N="); scanf ("%d",&numOfStars); for( ; counter<=numOfStars; counter++) { for( ;numOfStars>0; numOfStars--) { if (numOfStars != 9999) { for (count = 0;count < numOfStars; … | |
Hi I've saw the following piece of code (it doesn't work in this form why?:-O): [CODE] #define CPU AMD #if (CPU == INTEL ) printf("Intel\n"); #elif (CPU == AMD ) printf("AMD\n"); #else printf("CPU isn't defined\n"); #endif [/CODE] Note I tried this on M$ complier & GNU gcc works the same | |
Hi Guys (and gals), Thanks for taking the time to read this, hope someone can help. I've been tasked with developing an anti-virus scanner as part of a university assignment. I've written all the signature matching code, which works fine, and the software can scan through a directory and find … | |
Hello when Im trying to learn strncpy function, I copied a part of string to another char array, but it gave me different results when I used puts and printf functions. Can anyone tell me why such difference occurs? I guess its about the last terminating NULL character, but Im … | |
I am trying to write a program in C with a main function and five other functions: input, output, calculate day of year for a calendar date, calculate calendar date from day of year and year, and determine if its a leap year function. I have a problem with calendar … | |
| Hi, I am attempting to create a dynamic array using realloc in 2 dimensions. Currently i have managed to get it to work using realloc to dynamically resize the amount of rows but when I attempt to use realloc to dynamically resize the amount of columns per row I keep … |
how would i be able to open and read a .obj file(for a 3D model)? i need to extract the vertexes and their normals | |
| I am writing a code to open a command line, prompt for the name of a file to copy, prompt for a new file name, then it should copy the file (adding a header and line numbers plus adding .lis to the filename of the new file). I BELIEVE I … |
how would i be able to seperate the text inside a file into the lines they are in? eg: [code] char *lines; lines = seperate_into_lines(a_file); /* not a function */ [/code] | |
Hey guys and gals, I just wrapped up my first year of University CS and I feel like tackling my first personal project. My program will need to read in the mp3 title, artist, and album of many mp3 tags. My problem is that in class I only dealt with … | |
he below code works fine with dec c++ compiler but when run on visual studio gives the error at fseek[code]#include<stdlib.h> #include<stdio.h> #include<conio.h> int main() { FILE *fp; char *stringBuff; int i; int epi = 0; long lSize; fopen_s (&fp, "sequence.txt" , "rb" ); fseek (fp ,0 , SEEK_SET); lSize = … | |
I've come across two questions from my previous years college test papers. I just couldn't solve them [LIST=1] [*][I]Define rational number as an ADT (abstract data structure)[/I] [*][I]Write a suitable C code to sort a finite set of elements where an element may appear a large number of times[/I] [/LIST] … | |
Hey, I am new here. I just started coding in C a couple of weeks ago. I am trying to create a simple program to input data into an array using a text file with 10 records. However, the array length is 16 and a couple of records in the … |
The End.