19,876 Topics

Member Avatar for
Member Avatar for iamnot

This code is give in a data structures book I issued from my library. I am not able to understand how the functions are working. I am aware of the algorithms. Can anyone please explain how qinsert(),qremove(),build(),encode() are working.Please explain in detail [CODE]#include <stdio.h> #include <string.h> typedef struct node_t { …

Member Avatar for Mouche
0
236
Member Avatar for techyworld

Write a program containing a function that takes 2 integer parameters x and y and returns the value of x2 + y2. The main program should then allow the input of two integer values a and b and display the value of a2+b2. Can someone help me?am having this error: …

Member Avatar for techyworld
0
112
Member Avatar for swissknife007

What are the settings I require so I can debug line -by line? Or else ,I can identify lines of code where run time errors are occuring.. I want to view exact line number of error in this code/[CODE]#include<stdio.h> #include<conio.h> #include<string.h> struct node {struct node * left,*right; int freq; char …

Member Avatar for gourav1
0
299
Member Avatar for guidely

Hi, I having problem with enter file name to read file it give me result like this [CODE] Please Enter Ship File path or Ship File name: data Segmentation fault: 11 [/CODE] Here is my code [CODE] #include <stdio.h> #include <stdlib.h> struct harbour { int harbourId; int maxCap; int timeUpload; …

Member Avatar for WaltP
0
221
Member Avatar for guitarguy889

Hello Daniweb! :) I am brand new to this site, and wish I didn't need the help but I do! So let's give it a go shall we? I have a program I have been working on for about two weeks now, and I feel like it should not be …

Member Avatar for WaltP
0
191
Member Avatar for loserspearl

I have my program working and logic correct and I'm able to use another function and just fine, but my requirements are to pass the addresses of my three variable hour, min, sec, not the actual variable itself (which is declared 0 when it reaches the time() function) I've just …

Member Avatar for loserspearl
0
98
Member Avatar for cdudefire

Does anyone know any good websites that offer programming tutorials. Maybe similar to Kahn Academy, with videos and exercises.

Member Avatar for andrewll2
0
80
Member Avatar for moroccanplaya

Hi i want to know if C is the best language for image manipulation and creating a steganography tool?, if so how would i go implementing steganography and can anyone recommend any reading materials and libraries needed.

Member Avatar for Moschops
0
183
Member Avatar for iamnot

[CODE]#include<stdio.h> #include<conio.h> #include<string.h> struct node {struct node * left,*right; int freq; char c; }; typedef struct node node; int front=1; node * q[256]; char * code[128]={0},array[1024]; node * new (int freq,char c,node * a ,node * b) { node * n=(node *)malloc(sizeof(node )); if(freq) {n->c=c; n->freq=freq;} else {n->left=a;n->right=b; n->freq=a->freq+b->freq; } …

Member Avatar for gerard4143
0
191
Member Avatar for vedro-compota

hi there) guys, plesae tell me - what should i change in this code to see message in a console window (i also need define the OS) = [CODE]#include <stdio.h> #if defined(_WIN32) || defined (_WIN64) #include <windows.h> #define WINDOWSS 1; #endif int main() { char* mtext = " Please specify …

Member Avatar for vedro-compota
0
1K
Member Avatar for ath1019
Member Avatar for Ancient Dragon
0
90
Member Avatar for nssltd

Okay hi, Firstly i have a border less which i need as i have my own custom 'skin' which looks like this and is found here.[URL="http://i51.tinypic.com/2i77o94.png"]http://i51.tinypic.com/2i77o94.png[/URL] As you can see it has no drop shadow at all. What i want to achieve is for it to have a drop shadow …

Member Avatar for Mitja Bonca
0
5K
Member Avatar for guidely

Hi I dont know why when I run in xcode it give me exec bad access but when I run using terminal it work fine Here is mt code [CODE] // // main.c // Harbour Unload System // // Created by Guide on 15/10/11. // Copyright 2011 __MyCompanyName__. All rights …

Member Avatar for guidely
0
170
Member Avatar for moroccanplaya

does anyone know where to start on this i want to make a command line c program which hides messages in images and audio files is there any books i can read to get this started

Member Avatar for WaltP
0
117
Member Avatar for guidely

Hi, I get a output result: Segmentation fault: 11 when I tried to do quick sort a time in ship structure Here is my code [CODE] #include <stdio.h> struct harbour { int harbourId; int maxCap; int timeUpload; double amount; }; struct ship { int number; int shipId; int sMaxCap; int …

Member Avatar for guidely
0
4K
Member Avatar for gAb1

Hi, i've a problem and hope you can help me :) I was seeing other post [url]http://www.daniweb.com/software-development/c/threads/269500[/url] but my problem is diferent... I want to copy some content of a webpage to make a db in different locales. The webpage by example is web.com/name=123, 123 is the id. The page …

0
249
Member Avatar for shweta agrawal

i have an project encrypting an grayscale image in c language. Before encrypting first i want to calculate its header that define it file format, and convert image data into a binary value. i don`t know how to do this please help me?

Member Avatar for andrewll2
0
75
Member Avatar for swissknife007

Can anyone give me starting ideas about creating B-Tree? For example,how to define a node structure in a B-tree?

Member Avatar for gerard4143
0
49
Member Avatar for ckwolfe

I am trying to read in a command-line argument like: >a.out memtest -b 4 -s 1000 And the intended result is to store "4" in the variable represented by -b and store "1000" in the variable represented by -s. I have the following code: [CODE]int main (int argc, char **argv){ …

Member Avatar for ckwolfe
0
303
Member Avatar for loserspearl

I have two programs here I cannot seem to get any return value and I have no idea why, everything I'm doing is just like my book says and I cannot get it working. The parts commented out are the other ways I was trying to make this work, somethings …

Member Avatar for loserspearl
0
109
Member Avatar for swissknife007

[CODE]#define max 50 struct code{int bits[max];int start;};typedef struct code code; struct node{int freq;int father;int isleft;};typedef struct node node; void insert(int,int); int del(int); main() { code cd,code1[max]; node node1[max*2-1]; int i,k,n,p,p1,p2,root,rootnodes; char symb,alph[max]; for(i=0;i<max;i++) alph[i]=' '; rootnodes=0; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%s""%d",&symb,&node1[i].freq); insert(rootnodes,i); alph[i]=symb; } for(p=n;p<2*n-1;n++) { p1=del(rootnodes); p2=del(rootnodes); node1[p1].father=p; node1[p1].isleft=1; node1[p2].father=p; …

Member Avatar for vedro-compota
0
135
Member Avatar for ashishtrivedi

A console application to multiply two matrix of float numbers and print result on console. Some memory checks are done as it is allocating memory dynamicaly. May give error and exit when short of memory.

Member Avatar for aravindanne
0
222
Member Avatar for l0v3csci

Having trouble computing the number of occupied neighbors each cell in the array has. Any help would be greatly appreciated. [CODE] Array[rows][cols-1] Array[rows+1][cols-1] Array[rows-1][cols] Array[rows][cols] Array[rows+1][cols] Array[rows-1][cols+1] Array[rows][cols+1] Array[rows+1][cols+1] [/CODE]

Member Avatar for Fbody
0
8K
Member Avatar for manaila

I have recently come along a struct of this sort: [CODE]struct Context { Context(): addTitle(false) { } bool addTitle; std::string title; };[/CODE] It looked strange, especially the [B][I]Context(): addTitle(false) { }[/I][/B] part. Can anyone please explain it for me.

Member Avatar for Moschops
0
90
Member Avatar for prestige9

Dennis Ritchie died at age 70. Great loss the creator of C and co-inventor of Unix.Few people can truly say they changed the world. And Dennis certainly is one of the few. RIP Dennis, but also thanks for making the world in which we live in today! Thank you Dennis …

Member Avatar for MonsieurPointer
0
123
Member Avatar for liverpiece

How to write a tic tac toe game program in c language using int char array with the help of for & while loop

Member Avatar for liverpiece
0
86
Member Avatar for Siimont

Hello! I'm doing a calculator in c# and I have one problem. I can't get the "%" button to work. I want it to work just like microsofts calculator and it would be great if annyone could help me! :) Its the code for how to calculate it I need!

Member Avatar for aadisabri
0
2K
Member Avatar for eagles39

I have written a function to place mines. I need 'X' to be in array position [0][0] I cannot randomize so it does not overlap the mines b/c I can have only four mines in a [4][5] array. The problem I am having so that it checks to see if …

Member Avatar for WaltP
0
423
Member Avatar for BobTheLob

Hey, so I'm having some difficulty getting my make file to work. When I try to make, I get this: [CODE]andrew@Samantha ~/Documents/OS_Projects/Chapter 6 $ ls Makefile Makefile_old semaphore.c andrew@Samantha ~/Documents/OS_Projects/Chapter 6 $ make make -C /lib/modules/2.6.38-8-generic/build SUBDIRS=/home/andrew/Documents/OS_Projects/Chapter 6 modules make[1]: Entering directory `/usr/src/linux-headers-2.6.38-8-generic' make[1]: *** No rule to make target …

Member Avatar for BobTheLob
0
173
Member Avatar for infantheartlyje

Hi folks, [CODE] int a=10,b=5,tmp; tmp=a; a=b; b=tmp; [/CODE] This is ordinary swap. I want to do this swap to the structure variables. And how to free the memory of tmp structure variable after swapping.

Member Avatar for WaltP
0
226
Member Avatar for stinkypete

I've been looking around for code snippets for generating pseudo-random numbers. A lot of them seem to be very similar, for example [CODE]double findnoise(int x) { int x = (x<<13) ^ x; return (double)( 1.0 - ( (x * (x * x * 15731 + 789221) + 1376312589) & Ox7fffffff) …

Member Avatar for gerard4143
0
109
Member Avatar for valestrom

So I'm making this periodic table application, and spent an hour laying it all out. Perfectly I must add. Now I'm trying to figure out how to get it so when I click a button it opens the new form (Have this done) and replace the value of some labels/textboxes …

Member Avatar for valestrom
0
214
Member Avatar for guidely

Hi, I just wondering how to Passing structures of array to functions Here is my code [CODE] #include <stdio.h> struct harbour { int harbourId; int maxCap; int timeUpload; double amount; }; struct ship { int number; int shipId; int sMaxCap; int sActCap; int aTime; }; void readHarbour() { int i=0, …

Member Avatar for thines01
0
221
Member Avatar for dineshz

I have a problem with this code. Why this shows random symbols when i give view data ! ?[CODE]#include<iostream> #include<conio.h> #include<windows.h> #include "gotoxy.h" #include<cstdio> #include<cstring> #include<cstdlib> #include<fstream.h> using namespace std; //function declarations void out(char *); void matrix(int,int); class student { public: //class variable declaration in public part int roll,fee,ht,wt; char …

Member Avatar for VernonDozier
0
603
Member Avatar for kiranroy

[COLOR="Red"][B]ATTENTION!!!!!!!!!!!![/B][/COLOR] [B]HELP..........NEEDssssssssss............[/B] [B][U]how can I implement the C code of the descending tree and ascending tree of PRAM.....in openMp.........?????[/U][/B]

Member Avatar for kiranroy
-1
41
Member Avatar for 07-0466

Hey, What is the fastest way to learn C#?? I need to clean out some source code with bugs... Help needed urgently! Thanx.

Member Avatar for 07-0466
0
117
Member Avatar for swissknife007

[CODE] #include<stdio.h> #include<conio.h> #include<stdlib.h> struct node {struct node * left; struct node * right; int info; }; typedef struct node node; node * root=NULL,*loc,*par,*save,*child; int item; void pre(node *); void in(node *); void post(node *); void find() { node * ptr; loc=root; par=NULL; if(root==NULL) { loc=NULL; par=NULL; return; } if(root->info==item) …

Member Avatar for swissknife007
0
257
Member Avatar for ZedChu

Hi, I need to read unsigned integer and I want to read it number by number. I did this function. But it has "one bug". It can't read number like 4 294 967 295. Max what it reads is like 4 294 967 29. It's because I multiplied it by …

Member Avatar for ZedChu
0
228
Member Avatar for annonymous21

I started working on a select server and am encountering some issues. Heres the problem; I ran an strace on my select server and i fired it up and it creates the socket, binds, listens, and select waits for input. When you connect the client, select adds a file descriptor …

Member Avatar for D33wakar
0
132
Member Avatar for Ravic85

So, I've got my program up and running, and everything is great except my problem is I can't figure out why my output for my original balance and my output for my new balance are the same and it won't do my calculation Here is my header [CODE] #ifndef SavingsAccount_H …

Member Avatar for Ravic85
0
171
Member Avatar for educated_fool

Hello, dear All I have the following problem: i have a .net (C#) app and a Windows Installer project to deploy it. Now i want this Installer project be able not just to install the app onto a 'bare' client machine, but also to check if some previous version of …

Member Avatar for narin143
0
965
Member Avatar for infantheartlyje

Hi folks, I want to check two dates. The date format [MMDDYYYY]. for e.g., 01252000 . I want separate the day , month, and year into a integer. How can i do this?

Member Avatar for infantheartlyje
0
364
Member Avatar for infantheartlyje

Hi folks, this is my code. I'm passing a date string [MMDDYYYY](e.g., 01022000) to the function check periods. Now i send the date to sepdate function. This function should separate the dates. if i print the returned array, am getting wrong answer. [CODE] int *sepdate(char *date) { long int dt; …

Member Avatar for infantheartlyje
0
140
Member Avatar for gumbum8

Hello daniweb! Yes, I'm another amateur coder who needs a little assistance getting some code to work, I hope it's alright :?: A little background is necessary I suppose, so the deal is I'm a self taught noob who's working on a pet project of crafting a little program that …

Member Avatar for gumbum8
0
189
Member Avatar for minimi

This is what I have so far. I have to create array of 10 int values as local variable then iterate through the array elements using pointer, print address, and value of the each item. But this is my output. It should print values from 0 to 10, but mine …

Member Avatar for gerard4143
0
136
Member Avatar for TArrington21

Having trouble trying to read characters from a file into a 2D array. I know this topic has been discussed before but your help will be greatly appreciated. I know there is more efficient ways of writing the entire code but im not that familiar with programing. Any suggestions are …

Member Avatar for TArrington21
0
131
Member Avatar for aKiLa.. :)

i want to do a project in c programming.. what topic should i choose and what all should i include to make it look decent?

Member Avatar for sergent
0
217
Member Avatar for Gaiety

Hello , i have read the manual page of alloca , it is documented there that "alloca works similar to the malloc but it allocates memory from stack and frees automatically. i can't get how can i use that in a program . if i'm not wrong can i use …

Member Avatar for monishch
0
187
Member Avatar for NV43

Below I have attached my code. The problem I am having is that I do not think it is properly computing the sum. It seems as if its missing a number or something along those lines. The program is supposed to read an input number, n, which must be a …

Member Avatar for nezachem
0
167
Member Avatar for s_r_k

The End.