15,539 Topics

Member Avatar for
Member Avatar for Fili

I have a very important question (for me) How do i use <alloc.h>/<malloc.h>/<stdlib.h> for memory allocation? i'm talking about: malloc(),calloc(),halloc(),realloc(),alloca(),heapwalk(),free() etc? i'm having a lot of trouble with these! thank you!! :confused:

Member Avatar for Fili
0
212
Member Avatar for minnie

Need to define a new type in "C." New type is "datetime." Use two variables: birthDate, tempdate If I use birthdate= tempdate + 20; how can I assign 20 to be: minutes years seconds days

Member Avatar for FireNet
0
103
Member Avatar for fasteddie19793

I am struggling to derive answers for this problem. I need detail explanation. I understand the problem has to do with manipulating and trying values to derive what is n but don't understand :D :rolleyes: Considering the following nested loops, for(j = 5; j<=n; j++) { j =n; while(k > …

Member Avatar for fasteddie19793
0
162
Member Avatar for tlee

Hi all, What should I write for function signature in order to return this 6X6 array without compiler error? I tried to use `int* getGraph()`, but it did not work. Thanks for your help. int[6][6] getGraph() { int graph[6][6] = { {0, 5, 10, -1, -1, -1}, {-1, 0, -1, …

Member Avatar for tlee
0
169
Member Avatar for Bleek

i dont know why im asking this... im just curious. I have dev-cpp compiler and i was experimenting with header files and reading them expanding my knowledge... and im just wondering what the difference between a c header file and an h header file is... they seem to be doing …

Member Avatar for FireNet
0
149
Member Avatar for onickel

Hi! Pls, somebody help me!! I'm stuck here since days. I don't know, what i'm doing wrong.

Member Avatar for onickel
1
110
Member Avatar for hkpkguy

[img]http://img19.imageshack.us/img19/9384/f5.JPG[/img] #include <stdio.h> #include <math.h> void main() { double a,b,c,disc,x1,x2; printf("To find the roots of a quadriatic equation with real roots\n") disc=b*b-4*a*c if(disc<0) printf("The roots are complex",disc); if(disc>=0) printf("-b+sqrt(disc)/2a",x1); printf("-b-sqrt(disc)/2a",x2); This is what i wrote, i know it is missing alot but I really dunno how to do it, so …

Member Avatar for Killer_Typo
1
215
Member Avatar for dw85745

Is there anyway to debug a link error? After looking up LNK 2005 in MSDN where do I go next?? Thanks David

Member Avatar for FireNet
1
118
Member Avatar for BlackDice

Polymorphism is what makes using inheritance so powerful ( in my opinion). Here's a quick example of it using objects. This example uses 3 classes: CCar, and CSportsCar and CLuxuryCar which are derived from CCar. [code]class CCar { //constructors and other stuff... virtual CString GetType() { return "Car";) } ; …

Member Avatar for Dani
0
110
Member Avatar for dooda man

hi , i am using simple console application and i am asking about the way to make the program depend on time insead of dependng on pressing keys for example, i want siplay the word "Hello.." and after 5 seconds it changes to "World" , to elaborate .. i want …

Member Avatar for FireNet
0
147
Member Avatar for Saleh

Is there any reference or step-by-step tutorial available on-line showing how to control CD-Drive tray? thanx in advance.

Member Avatar for Yzk
0
110
Member Avatar for keir.whitlock

Hi there, Is it posible to declare multiple image handlers using an array? Example: HBITMAP ARRAY[10]; //Then use a loop to display a different bitmap for each member of the array? while(count < 10){ mkey1[count] = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_BITMAP)); Something like that, obviously changing the bitmap each time it goes round …

0
93
Member Avatar for FattMarrell

Okay so im making this program to accept three integers for two different users (# of units for three quarters, for two people). Then im multiplying that number by the unit cost of 12. Then finally i divide that by 2 to get the average for both people. This is …

Member Avatar for FattMarrell
1
145
Member Avatar for meabed

I tried to desigen program that format partition from the HDD. like D:... then i right this code [CODE]#include<process.h> int main() { system("d:"); system("format d: /q"); system("y"); return 0; }[/CODE] but it comes to ( " all data on non_removalbe disk driver d:will be lost ! proceed with format (Y/N)? …

Member Avatar for meabed
0
182
Member Avatar for priya

Hello everyone, iam a new one into this forum. Can anyone tell about what is the significance of programming c in UNIX

Member Avatar for alc6379
2
83
Member Avatar for sboothman

Hey guys, I am having a small problem with my code, see below. /*************************************************************** * RADAR_SYSTEM * * VERSION: 1.1 * * AUTHOR: 205123 * * DATE: 23/03/04 * * /**************************************************************/ #include <stdio.h> #include "radar_gen.h" #include <math.h> int max_aircraft=2; int main() { int i,j; float aircraft_distance,aircraft_range,aircraft_x_pos,aircraft_y_pos,aircraft_altitude,e; struct radar_data aircraft[30]; struct …

1
70
Member Avatar for meabed

hello, i want to sort a file and i don't know how to put the data from a certain field of the file in a vector, sort it and then put it back in the file. here's what i've done. [CODE]FILE *file; struct catalog{char 1rst_field,2nd_field,3rd_field}name,v[100]; //here i put the data …

0
132
Member Avatar for bones

hi people i was wondering how you create a test plan im new to this and just created my 1st c game... need some help as im not sure how to create a test plan preferably in a table. [CODE] /*In order to play the game of craps. each player …

Member Avatar for infamous
0
185
Member Avatar for FireNet

How many of you guys belive it is possible to program a server and create within it a simple environment in which people can write their own pieces of code and complie it without problems. This server should be capable of using multiple 'plugins'(the pieces to code which others write …

Member Avatar for FireNet
0
159
Member Avatar for dirs

Blackjack class is derived from card class ( see attached playingcard.h and blackjack.h) I have problem with: void blackjack::DealCards() function. I want to use function deal_hands from card class to set the value of pcard1 pcard2, dcard1 and dcard2. How could I do that???

Member Avatar for BlackDice
0
129
Member Avatar for keir.whitlock
Member Avatar for marceta

Hi guys, im new to this forum but congratulations, i looks great Im making a game for a TAFE class (which i will gladly send to any1). The game is a text based Role Playing Game. I am finished early so i am going to improve my current game. I …

Member Avatar for marceta
0
290
Member Avatar for AmericanD

[code]int gcd (int num1, int num2) { int remainder; if (num1 > num2) remainder = num1 % num2; else remainder = num2 % num1; if(remainder!=0) { return gcd(remainder, num1); } return num1; } int gcd2 (int num1, int num2) { int remainder; return ( remainder = ( num1 > num2 …

Member Avatar for AmericanD
0
156
Member Avatar for skywing

Today I saw a program running in DOS environment but had a XP style ! So far, I can make a "rectangle" window that can move, close,...with C language, but it still looks like Windows 3.1 or so. Therefore I wonder how he (the author) could make such windows and …

Member Avatar for BountyX
0
112
Member Avatar for liliafan

Hi I am getting an error with some code, it compiles fine on linux but it is throwing an error on solaris, it is to do with strtok_r, the following is the error message: sku_cache.cpp:150: implicit declaration of function `int strtok_r(...)' sku_cache.cpp:150: assignment to `char *' from `int' lacks a …

Member Avatar for liliafan
0
241
Member Avatar for raybulba

I've tried to use a bunch of example programs that make use of "G2++.h" and "g2_X11++.h" but my compiler complains that I don't have those files! Furthermore I can't find any place where I can download such files. All I can find is the old g2 stuff. Does anyone know …

Member Avatar for vesselin
0
178
Member Avatar for ScriptBoy

hi, i need to make a small program, which makes a connection to the sybase database running on unix machine. i'm new to this server client programming. pls help !

Member Avatar for liliafan
0
84
Member Avatar for MrCool

Hi there, I am currently converting a matlab file to C, and need some help writing the data calculated in 2D arrays to files. This is what i ahve done so far: <snip> File *U; File *V; File *X; File *Y; U = fopen("U.txt", "w"); V = fopen("V.txt", "w"); X …

Member Avatar for BountyX
0
219
Member Avatar for DanteInHell

As I've decided to learn how to program, and what language I want to learn (C), I'm now left with a BIG question. Do I need to learn computer theory? I've seen many posts on this forum by people who have taught themselves with books, tutorials, and much hard work. …

Member Avatar for Dani
0
151
Member Avatar for CocoDan

I own a RD1071 RCA LYRA MP3 player. I was wondering if anyone knew what programming language it uses. The main chip is the STMP3410. It handles everything good. I can update the device with new firmware and I would like to change it a little. The update files are …

Member Avatar for BountyX
1
265

The End.