14 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for dancks

I don't know jack about Visual Studio, and I'd like to keep it that way because I like doing stuff on the command line, I have my preferences. But my teacher uses it to compile and I'm curious what I did wrong because gcc didn't throw anything. So, code (Without …

Member Avatar for dancks
0
197
Member Avatar for alaa sam

Hi everyone well currently I am working on a simple malloc and free implementation but I am facing some problems . I get a segmentation fault this is my output inserting node 0 0xc87000 inserting node 1 0xc87014 inserting node 2 0xc87028 inserting node 3 0xc8703c inserting node 4 0xc87050 …

Member Avatar for alaa sam
0
209
Member Avatar for Kashaku

Hi. Sooner or later I had to go into the depths of C. Today was the day I tried my first things with C. However, I am having a problem although I do not know what actually causes it. The goal of the pogram is to combine the parameters into …

Member Avatar for Kashaku
0
154
Member Avatar for TreeBranches

My program begins by opening a dictionary file, the first line of which contains the number of words in the dictionary. If I print the words immediately after scanning them into the arrays, they appear fine, but if I later examine a previous entry, I can see it has been …

Member Avatar for TreeBranches
0
207
Member Avatar for anitaNg

what is wrong with my code?i cant figure it out. [CODE] #include<iostream.h> #include<stdlib.h> #include<stdio.h> #define MAX 50 struct Node { char judul[MAX]; char pengarang[MAX]; int harga; Node* nextPtr; }; Node* makeNode(char judul[], char pengarang[], int harga) { Node* newNodePtr = (Node*)malloc(sizeof(Node)); if(newNodePtr == NULL) { cout << "Out of Memory" …

Member Avatar for jonsca
0
140
Member Avatar for n1csaf3

I am having trouble correctly allocating memory for a parent function that will remain upon the child functions exit. the call to the child function is [code=c]HTTP_packToGen((char*)http_headerContent.HTTP ..[/code] the HTTP variable within http_headerContent is a char pointer that isn't allocated until the child function is called, http_headerContent is a static …

Member Avatar for n1csaf3
0
318
Member Avatar for IndianaRonaldo

char* p=(char*)malloc(10); in the above state ment,has the memory been initialised??...what is the difference between allocatingg it and initialising it?? thanks in avdance...

Member Avatar for IndianaRonaldo
0
206
Member Avatar for Buffalo101

Hello, This is an extension of this thread: [url]http://www.daniweb.com/software-development/c/threads/357681/1525001#post1525001[/url] My purpose is to create a class that handles a network message. Irrelevant, anyway. CMyMessage: [code=C] #include "stdafx.h" #pragma once #include <conio.h> #include <stdio.h> #include <iostream> #pragma once using namespace std; typedef unsigned char byte; class CMyMessage { protected: byte type; …

Member Avatar for Buffalo101
0
681
Member Avatar for efronefron

The problem is I use malloc in the last function(toString()). I just wanna know if there is anyway to free it? or that I dont have to? Thanks [CODE] #include<stdio.h> #include<string.h> #include<stdlib.h> #include<ctype.h> /* Function prototypes */ void process(char input); void update(char words[][51], int position); char * toString(char character); /* …

Member Avatar for WaltP
0
210
Member Avatar for CodeAerial

HMm... already frustrated at it... But is there something wrong in my malloc? Everytime I try to display the record, it gives me random things as answer(see code below)? Was it that I didn't free it or was I wrong in declaring malloc itself? Thanks in advance. [CODE] #include <stdio.h> …

Member Avatar for CodeAerial
0
279
Member Avatar for fussballer

Hi, This is probably, a really novice question, but I have some code that is using the malloc() function to declare an array, the problem is that I am using a special compiler to compile code for hardware which gives me a lot of errors because of the stdlib.h header …

Member Avatar for mitrmkar
0
233
Member Avatar for new_programmer

I have basic idea about malloc and calloc i heard about falloc and dlmalloc, can any one explain about it?

Member Avatar for new_programmer
0
178
Member Avatar for evinkeating

I've a 2-d array declared as such [CODE]lower_tri = (float **)malloc(sizeof(float *)*(dimention)); for(i =0; i < dimention; ++i) lower_tri[i] = (float *)malloc(sizeof(float)*(i+1));[/CODE] So that it looks like... [] [][] [][][] [][][][] ... However, it causes a segmentation fault when I try to de-allocate the array with [CODE]free(lower_tri);[/CODE] (only in unix, …

Member Avatar for Ancient Dragon
0
202
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

The End.