15,539 Topics

Member Avatar for
Member Avatar for Yesiid

[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; …

-1
31
Member Avatar for BLUEC0RE

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 …

Member Avatar for jephthah
0
119
Member Avatar for martinjcloud

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) { …

Member Avatar for jephthah
0
126
Member Avatar for wakingdevil

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++) { …

Member Avatar for jephthah
-3
88
Member Avatar for campbellpatrick

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 …

Member Avatar for BestJewSinceJC
1
182
Member Avatar for Voltron160

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 …

Member Avatar for jephthah
0
97
Member Avatar for manutd4life

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; …

Member Avatar for abhimanipal
0
206
Member Avatar for mbw4359

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

Member Avatar for Narue
0
36
Member Avatar for Th3one234

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 …

Member Avatar for Th3one234
0
109
Member Avatar for newbiecoder

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 …

Member Avatar for newbiecoder
0
659
Member Avatar for Ni6tO_

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 …

Member Avatar for Ni6tO_
0
161
Member Avatar for tcstom

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 …

Member Avatar for tcstom
0
4K
Member Avatar for tomtetlaw

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

Member Avatar for jephthah
0
151
Member Avatar for Griff0527

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 …

Member Avatar for Griff0527
0
220
Member Avatar for tomtetlaw

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]

Member Avatar for caut_baia
0
85
Member Avatar for BLUEC0RE

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 …

Member Avatar for BLUEC0RE
0
119
Member Avatar for busy

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 = …

Member Avatar for Salem
0
442
Member Avatar for xavier666

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] …

Member Avatar for Narue
0
131
Member Avatar for jksdua

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 …

Member Avatar for jephthah
1
129
Member Avatar for gagansaini599

hey plz can anyone do this for me Task-1: 1. Write a C code that takes a file as input. Say input.txt which has the information about the object to be transformed, type of transformation, etc. 2. Input file can have following different formats. Case 1: P # first line …

Member Avatar for Fbody
0
117
Member Avatar for rend

hay!!! please can Write a program that accepts as input a date in the form, MM-DD-YYYY, where MM represents the month of the year, DD represents the day within the month and YYYY represents the century and year. After input of the date, display the date in textual format and …

Member Avatar for jephthah
-2
76
Member Avatar for zyx

Hey guys, i'm having trouble with having to simulate a user entered number of parties and user entered number of guests. I am supposed to have a function with the prototype int party(int n) that will simulate one group at a time with n guests. I have to assign each …

Member Avatar for Salem
0
145
Member Avatar for jsphb9000

Hi, I just started taking a programming class and am having trouble figuring out why this wont program wont work correctly. The user inputs their coordinates and the program returns whether it is in quadrants 1,2,3,4 or on an axis or the origin. [code=c]#include <stdio.h> int main(void) { double xcoord, …

Member Avatar for gerard4143
0
263
Member Avatar for emmas4impact

hello everyone, I wrote some code on binary search in algorithms using c but here is my problem: [CODE] #include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <time.h> #include <ctype.h> /* TASK: Demo about static, linear data handling. Four basic operations are exercised: 1) find 2) insert …

Member Avatar for Adak
0
132
Member Avatar for OzY360

I got this code from a book and it doesn't seem to work. I've triple checked for common mistakes and syntax errors but can't find any. Please tell me where I am going wrong. #include <pthread.h> #include <stdio.h> #define NUM_THREADS 5 int main(int argc, char *argv[]){ int i, scope; pthread_t …

Member Avatar for OzY360
-1
204
Member Avatar for scarypajamas

Maybe you could help me with the following code... [CODE=c] int main() { char foo = '?'; // foo is created on the stack. char* bar = "Hello World"; // where is bar created? // will the following result as a NOP or undefined behavior? free(bar); return 0; } [/CODE] …

Member Avatar for scarypajamas
0
105
Member Avatar for manju_b_2006
Member Avatar for Adak
-2
588
Member Avatar for rlhh

After a lot of trial & errors, I've managed to create an array as follow : xxx xxx xxx xxx 000 000 xxx 000 000 x00 000 000 x00 000 000 x00 000 000 x00 000 000 x00 000 000 x00 000 000 Now, when a user enters a value …

Member Avatar for Adak
0
167
Member Avatar for overRun

[CODE] typedef struct grid Grid; struct grid{ char grid[MAX_ROW][MAX_COL]; } void storeGrid(Grid *store_grid,int row, int col){ Grid *store_grid; store_grid = (Grid)malloc(sizeof(Grid)); //Grid storeGrid; //int grid[MAX_ROW][MAX_COL]; int rowNum, colNum; for(rowNum = 0; rowNum <= row; rowNum++){ for(colNum = 0;colNum < col; colNum++){ store_grid->grid[rowNum - 1][colNum] = 'a'; } } // Calls …

Member Avatar for Salem
0
81
Member Avatar for ayushky

sir i want to lock with password protection to my '.c' files.how i can do that. please suggest sir. thanks

Member Avatar for Ancient Dragon
0
179

The End.