15,552 Topics

Member Avatar for
Member Avatar for Prabakar

I happened to try find the total number of ways a horse can cover all 64 squares in a chess board without visiting a square more than once starting from one corner. All I was able to do was to use a brute force algorithm which run for a whole …

Member Avatar for Prabakar
0
184
Member Avatar for riahc3

Hey everyone. Glad to become part of this community and I hope I continue to come here for a long time seeing as this site gives great helps. My problem: I have a struct that is (for example) the following: [code] #define NUM 999 struct client { int id; char …

Member Avatar for Clockowl
0
178
Member Avatar for Aleczz

I have a debug assertion failed problem with akrip code. That code is downloadable from [url]http://akrip.sourceforge.net/simple.c[/url] I have add a new code to function RipAudio(...) where i want to add new folder and name the file to it. [code] void RipAudio( HCDROM hCD, DWORD dwStart, DWORD dwLen, int song ) …

Member Avatar for Aleczz
0
312
Member Avatar for toolbox03
Member Avatar for jephthah
0
228
Member Avatar for virtual_friend

[[U]I][B]My Doubly linked list doesnt work when i try to display using backward/reverse traversal... Will you please help me....[/B][/I][/U] [IMG]http://www.withfriendship.com/user/images/616/1vijay.jpg[/IMG]

Member Avatar for mitrmkar
0
73
Member Avatar for Google Spider

Hi, [URL="http://www.webinmind.net/bpc.html#two"][U][COLOR="Red"]Someone told me to use this code to clear the input buffer..[/COLOR][/U] [/URL] [code]while((ch=getchar())!='\n' && ch !=EOF);[/code] But I fail to understand how it actually works. For example, there are two newline characters in the buffer [quote] [B][U]This is my buffer[/U][/B] \n \n [/quote] Now getchar() grabs the first …

Member Avatar for Narue
0
125
Member Avatar for ohhmygod

[CODE=c] #include <stdio.h> #define M 21 #define N 2 #define INPUTFILE "C:\\Documents and Settings\\Duy Anh Bui\\My Documents\\Uni Stuff\\Eng Computing\\Sourcecodes\\Exercise 2\\in.dat" #define ARRAYFILE "C:\\Documents and Settings\\Duy Anh Bui\\My Documents\\Uni Stuff\\Eng Computing\\Sourcecodes\\Exercise 2\\array.dat" float Quadratic(float,float,float); //Quadratic Function Prototype int main () // Start main() { float a[M][N] = {0}; // Array a …

Member Avatar for Ancient Dragon
0
176
Member Avatar for n.aggel

hi guys, it's been a while since i used c for anything so here goes a question tha may seem silly. I have 2 variable length arrays.... [code=c] int main() { int n = 5; int m = 6; int before[n][m]; int after[n][m]; array_function( 5, 6, before, after ); } …

Member Avatar for n.aggel
0
377
Member Avatar for l1985

Hi there I'm having a problem with gcc The code compiles just fine ,but it doesn't run I have a printf next to main but it doesn't even do that The code is supposed to be an http server ,implemented using Berkeley sockets ,but that doesn't really i just want …

Member Avatar for Salem
1
99
Member Avatar for kashi_787

I want to read file in binary mode using fread() into structure members. following is the code which works perfectly on Turbo C compiler(DOS base) but doesn't work for VC++ 6, it is giving exception at fread() statement. The input to this file we can give any .bmp file name …

Member Avatar for jephthah
0
140
Member Avatar for chazzquire

Hello, I'm trying to use getch several times in my program, but it is remembering earlier key presses. Is there a function or command I can use to clear the getch buffer? Or am is there something else I am doing wrong? Thank you. C.

Member Avatar for chazzquire
0
154
Member Avatar for Clockowl

hai. I'm trying to compile a program split up across multiple files. The code is far from complete, but I noticed lots of compiler warnings and errors. This ought to be due to splitting the code up: I thought the preprocessor simply copy and pasted the code into main.c when …

Member Avatar for Clockowl
0
125
Member Avatar for agabriel

Hello, Okay I'm stumped and can't figure out why this code chunk isn't working properly (works on square matrixs; everything else doesn't work).... uint8 * imageTranspose( uint8 *im ){ uint8 *im_transpose; int x, y, org_offset, tran_offset; int im_size = dims[0] * dims[1]; if ( (im_transpose = malloc(sizeof(uint16) * im_size)) == …

Member Avatar for Clockowl
0
3K
Member Avatar for xyster

I have a quick question that is been bugging me. [CODE]void swap(void *a, void *b) { void *tmp; tmp = a; a = b; b = tmp; }[/CODE] I wrote this intending it to be either able to swap a structure, or just the data defined within a structure. Will …

Member Avatar for xyster
0
100
Member Avatar for spirals

Not certain if this is the right place to ask this. I need to get two processes to use the same data. Process 1 reads text files, parses them and creates linked lists (structures).before this process terminates it display all the lists to prove the data has been loaded correctly. …

Member Avatar for spirals
0
106
Member Avatar for Sephy

So basically i got to make program where you can add rows, inside those rows numbers and count in each row and all rows pair number sum. This far im done and everything is working. Now part which don't want work. I need make option to make rows longer or …

Member Avatar for Duoas
0
106
Member Avatar for sjinadasa

Hi, This is my first post in this forum and it is a 'help me' post :) Anyway, I took a beginners class in C Programming and at the completion of the class we were assigned to do a project. The project is designing a billing system for a supermarket. …

Member Avatar for jephthah
0
105
Member Avatar for nony0905

[code]#include<stdio.h> #include<conio.h> #define MAX_ROWS 10 #define MAX_COLS 10 void add(int a[][MAX_COLS], int b[][MAX_COLS], int result[][MAX_COLS]); void displayValues(int(*)[MAX_COLS]); void diff(int a[][MAX_COLS], int b[][MAX_COLS], int result[][MAX_COLS]); void main() { int val; int i,j; int choice; int cols,rows; int operation; int table1[MAX_ROWS][MAX_COLS]; int table2[MAX_ROWS][MAX_COLS]; int result[MAX_ROWS][MAX_COLS]; clrscr(); printf("Press 1 to enter values for …

Member Avatar for Prabakar
0
141
Member Avatar for twgood

I have an assignment on currency I turned it in, and it is not right by no menas. I had no loops in any module, can anyone explain how to do a loop?

Member Avatar for allen.jes
0
115
Member Avatar for web_master

[CODE] #include<stdio.h> int main() { int i ,j ,a[5]; for(i=0;i<=4;i++) { printf("\n\tEnter the %dst value of the array: ", i+1); scanf("%d", &a[i]); } j = a[0]; printf("\n\tOriginal array entered by the user: "); for(i=0;i<=4;i++) { printf(" %d ", a[i]); if(a[i]<a[i+1]) { j = a[i+1]; } } printf("\n\n\tGreatest no. from the …

Member Avatar for varsha0702
0
96
Member Avatar for SonxQ7

Hi all, i'm using Visual Studio 2005 and by mistake enable the arrows which represents tabs and dots with represents spaces when coding... How do i disable this?

Member Avatar for SonxQ7
0
76
Member Avatar for twgood

I am wodering if i answered these correctly or not? Algorithm Verification Consider the following selection statement where X is an integer test score between 0 and 100. input X if (0 <= X and X < 49) output "you fail" else if (50 <= X and X < 70) …

Member Avatar for jephthah
0
202
Member Avatar for kv79

Hi all I am using Dev-C++ . I want , when I press Tab to skip a 3 blank places instead 6 . Thank you for your effort of reading .

Member Avatar for kv79
0
95
Member Avatar for emilio

i'm trying to get random numbers in a loop like this [CODE=syntax]#include <stdio.h> #include <time.h> int getRand ( int a , int b ) { return a+rand()%(b-a+1); } int main() { srand ( time( NULL ) ) ; int i; for(i=0 ; i<6 ; i++) printf("%d\n",getRand(0,9)); return 0; }[/CODE] the …

Member Avatar for emilio
0
115
Member Avatar for ohhmygod

I got this code here, i wonder why it doesnt put in the file "in.dat" in the same folder. [CODE] #include <stdio.h> #include <stdlib.h> #define N 20 //Number of trials void main(void) { FILE * pFile; float data[N][2]; int i,j ; char overwrite; for(i=0;i <= N ; i++) /* Initinalize …

Member Avatar for Ancient Dragon
0
219
Member Avatar for BigFormat

I have to pass a string to a function that strcats something to it, in K&R I read to pass a pointer to it, but I don't know where to allocate buffer... Is there a difference betw passing an empty string or not? My printf starts with some strange symbols, …

Member Avatar for BigFormat
0
2K
Member Avatar for InfernalDrake

Maybe my question is odd, or maybe already answered, but i didn't knew another way of searching a solution (the title i selected may get an idea of how weird is it) Its quite simple, i'm creating an application that has a command prompt, this is, like ms-dos the C:\>_ …

Member Avatar for InfernalDrake
0
78
Member Avatar for toolbox03
Member Avatar for jephthah
0
97
Member Avatar for Onixtender

Hi, I've have a problem of printing data from stack, if it's simple words,then stack works just fine,but if I try to push changed data using function(Written by a very intelligent moderator :) ), I get just the same word n times: Intelect Intelect Intelect .... [code] #include<stdio.h> #include<stdlib.h> #include …

Member Avatar for Onixtender
0
180
Member Avatar for nagaa
Member Avatar for Ancient Dragon
0
132

The End.