19,876 Topics

Member Avatar for
Member Avatar for InnocentVamp

Hello folks, I have some doubt regarding the creation of header files and libraries using C. Suppose I am defining all the functionalities related to the Stack and I wan to create it as library, for eg. stack.C which will get me the object file, Stack.o in Linux OS and …

Member Avatar for Narue
0
172
Member Avatar for infrapt

Hi I am trying to read a text file which has a few lines of double values I need to go line by line and put them in several arrays ex 4.2,3.4,5.7,8.7 2.5,6.4,4.4 How can I do this in C I also need to save the values in an arrays …

Member Avatar for gerard4143
0
55
Member Avatar for bun

[I]<< Thread split from [URL="http://www.daniweb.com/forums/thread29933.html"]here[/URL] >>[/I] hello.. i did not get it the programs that u wrote it.. for my own.. im looking for the factorial of the number that we entered.. for example.. 12 the factor of this is 2 2 3..that wat i want to mean.. in wat …

Member Avatar for bun
-1
111
Member Avatar for VernonDozier

I have some code to parse POST and GET parameters passed to a CGI program written in C and I'd like to test it out. To parse GET parameters, I need to access the QUERY_STRING environment variable, so I'd like to set that environment variable to different things and see …

Member Avatar for VernonDozier
0
847
Member Avatar for johndoe444

Hi, I have this problem. If the sender sends messages consecutively, like message 1 and message 2 and at the receiver attempt is made to read each message individually, then the receiver gets the both messages as the message 1. Is there any built-in mechanism such that the receiver delivers …

Member Avatar for gerard4143
0
114
Member Avatar for iammfa

Hi all, I'm beginner in c++, I'm trying practice on c++ basics, since few minutes I tried practice "setw" operator, I wrote this trivial program to print some data in console screen, but when I tried build it it gave me error..! [CODE]//print game names and my prefer rating in …

Member Avatar for WaltP
0
229
Member Avatar for invinate

hi, i'm having trouble compiling this code: SparseMatrix.h: [CODE] #ifndef SPARSE_MATRIX #define SPARSE_MATRIX #include <ostream> class SparseMatrix { //class data ... SparseMatrix operator+(const SparseMatrix& rhs) const; SparseMatrix operator*(const SparseMatrix& rhs) const; }; ostream& operator<<(ostream& out, SparseMatrix& rhs); #endif [/CODE] SparseMatrix.cpp: [CODE] #include "SparseMatrix.h" ostream& operator<<(ostream& out, SparseMatrix& rhs) { ... …

Member Avatar for invinate
0
212
Member Avatar for naveenreddy61

the code takes each character and stores where and how many times a roman numeral appears and the assess the integer. this is my first code im posting. anything to make the code better is most welcome. roman numeral refers to M=1000 D=500 C=100 L=50 X=10 V=5 I=1 and uses …

Member Avatar for WaltP
0
974
Member Avatar for katwalatapan

Hello, While compiling my code, I'm receiving a "Data access misaligned address violation" error. I tried to find the reason for the error, but am unable to pin point the location. I am trying to manipulate the amplitude envelope of an audio file, but this error occurs when i'm trying …

Member Avatar for Salem
0
186
Member Avatar for gillanism

hi all, i am really stuck with c++ pointer issues. what my program is supposed to do is to take input from user and recognize whether the entered string is a valid word from the grammer S::= a|(S) hence grammer should accept words like... a, (a), ((a)),(((a))).... i have done …

Member Avatar for gillanism
0
118
Member Avatar for jefanot

Hey, I was just wondering, but what code do you need to be able to press a few buttons on your keyboard. Like, if I want to type "Cheese is yellow on the moon!" I'll just run the program. Or if i want to do ctrl+alt+del to go to task …

Member Avatar for Ancient Dragon
0
614
Member Avatar for nathanurag

[CODE=c] #include<stdio.h> #include<math.h> main() { int i=0,j,c,s[100]; double t=0; while((c=getchar())!='\n') { s[i]=c; ++i; } for(j=i;j>0;--j) { t=t+(s[i-1]*(pow(16,(4-((double)i))))); --i; } printf("%d",(int)t); return 0; } [/CODE] HI, i need to write a program that converts an hexadecimal number into integer form (for convenience i'm only considering hexadecimal no. without alphabets from a …

Member Avatar for adnan.siddique
0
126
Member Avatar for jrkeller27

Hi, I'm just wondering if there is a good place where I can find some tree implementations for c++ (Splay trees and Heaps, in particular). Any input on resources where there is source code for different tree implementations would be appreciated, as I don't have the time to write one …

Member Avatar for amromun
0
192
Member Avatar for cmsc

if I have this code : [CODE] # node* search2(node **root, int val){ # # node* temp = *root; # if(temp -> value == val){ # printf("found!\n"); # printf("ang root nfaun ay nasa : %d \n", temp -> value); # printf("dapat tigil na."); # return temp; # } # # …

Member Avatar for Nick Evan
-1
96
Member Avatar for sutty8303

I need help with this problem. I have tried writting the program, i just can not get it to run properly. Problem is: Create a function named 'circle_area' that will find the area of a circle. This function should have the following prototype: float circle_area(float radius) circle_area should return PI*r^2. …

Member Avatar for peter_budo
0
306
Member Avatar for lebanese007

Hello, I have a web app that on a buttonClick event it goes and checks a database for a particular field. if that field = a certain value, the app does something. is there a way to make this app run every x seconds rather than on a buttonClick? do …

Member Avatar for serkan sendur
0
195
Member Avatar for cmsc

i am making a binary search tree, but when i use some functions and return their values, i get an error when i have to print those values. i don't understand why. please help. [CODE] #include<stdio.h> #include<stdlib.h> #define N 10 typedef struct nodetag{ int value; struct nodetag *left; struct nodetag …

Member Avatar for cmsc
0
181
Member Avatar for wingers1290

Hi, i'm trying to create a program so i can log every person I meet, which i have done quite easily with databases. However i would also like to be able to log each time i meet that same person which is where i can't figure out what to do. …

Member Avatar for wingers1290
0
173
Member Avatar for nathanurag

[CODE=c] #include<stdio.h> void astrcat(char s[], char t[]); //to concatenate two string main() { int i=0,p=0,q=0,c; char s[100],t[100]; while((c=getchar())!='\n') s[p++]=c; while((c=getchar())!='\n') t[q++]=c; astrcat(s,t); while(s[i]!='\0') printf("%c",s[i++]); return 0; } void astrcat(char s[],char t[]) { int i, j; i = j = 0; while (s[i] != '\0') /* find end of s */ …

Member Avatar for nathanurag
0
111
Member Avatar for c0d3x

Hi, I need some assistance in how to count the number of lines in a given file. It is a small part of a homework assignment I have and I am having problems figuring it out. I am to assume that in each line there will be a maximum number …

Member Avatar for mitrmkar
0
2K
Member Avatar for Iam3R

[CODE] #define fst 1 int main() { #if( fst ==1 ) printf("FST\n"); #else printf("Dummy FST\n"); return 0; }[/CODE] if i replace the statement in line 4 with [ICODE] #if fst [/ICODE] also the code is working. can any one tell me what is the correct way , advantages and disadvantages.

Member Avatar for Dave Sinkula
0
103
Member Avatar for nsjoe

I'm new to using delegates and invoke methods. Can someone please quickly identify what I'm missing here. I know this code is no where near completed right now, but as is, it's working for what I'm trying to test. Basically I'm creating a simple client application that is receiving a …

Member Avatar for sknake
0
989
Member Avatar for smbee

I am new to C programs. I have tried to write the code for game of life. I started with just the first part. But its still not done. There are some errors. could you please point out where I am wrong? [code] #include<stdio.h> #include<stdio.h> #define NUM_ROWS 100 #define NUM_COLS …

Member Avatar for smbee
-1
309
Member Avatar for markfisher

Hello everyone I have been working on generic C data structure (Doubly Linked List) and I have a question: ------ List.c ----- [code] struct node { void *data; struct node *next; struct node *prev; }; struct list { unsigned int length; struct node *head; struct node *tail; }; typedef struct …

Member Avatar for markfisher
0
161
Member Avatar for Iamthedude

I am attempting to get an input that can have varied types, float, int and a string are the three, I'm using sscanf to analyze the input from a buffer but for some reason I am getting memory access violations and I don't really know why. Main program: [ICODE] #include …

Member Avatar for Iamthedude
0
121
Member Avatar for kde

I have binary search - this one , but i need to change it like this , that it will search : for example we have array {1,10,11,12,15,16,22,22,22,22,30,40} I want to find 22 but not randomly - or it will be first 22(that goes after 16) or last 22 (that …

Member Avatar for Ancient Dragon
0
94
Member Avatar for ppotter3

Hello! I have a question regarding the set up of my binary search. For my program I am working on, I have taken a .txt file full of first names and sent those first names to a string array. The names are then sorted, and from there I ask the …

Member Avatar for mitrmkar
0
714
Member Avatar for Soileau

I am getting a seg fault when I try to run this code. The compiler is also giving me odd warnings about how an integer constant is too long for "long" type. Here is the code: Declarations [CODE] #include<stdio.h> #include<string.h> #include<stdlib.h> void printstates(){ printf("Enter the number for the corresponding state:\n\ …

Member Avatar for Soileau
0
134
Member Avatar for mahima.b
Member Avatar for MrNoob

oke I was coding some stuff involving 2d array allocating i normally know how to do it in main coz you don't need to pass adr main ptr that get's allocated but when i made it i got somewhat confused I don't know why it went wrong [code] #include <stdio.h> …

Member Avatar for MrNoob
0
116
Member Avatar for freeseif

Hi programmers, I want read line by line a Unicode (UTF-8) text file created by Notepad, i don't want display the Unicode string in the screen, i want just read and compare the strings!. This code read ANSI file line by line, and compare the strings [B]What i want[/B] Read …

Member Avatar for Ancient Dragon
2
2K
Member Avatar for kamran_yusuf

The leap year thing is troubling, eg 29-02-2009 is not a leap year but it still displays a day which it should not. [code] #include<iostream> #include<conio.h> using namespace std; int main () { int d=0,m=0,y=0,r1=0,r2=0,r3=0,r4=0,l=0; cout<<"Enter day : "; cin>>d; cout<<endl; cout<<"Enter Month : "; cin>>m; cout<<endl; cout<<"Enter Year : …

Member Avatar for Ancient Dragon
0
92
Member Avatar for krishnampkkm

hiiii... I wanna create a small application .And by giving a user name and password only it allows the user to enter in to the application . Here I wanna store the user name a and pass word in a text file and I've to check it with the password …

Member Avatar for adcodingmaster
0
127
Member Avatar for Shaikh Mohsin

Hello Friend i want C program to scan Operating System on network,and display the output and can it is possible to connect to that particular OS.....or is there any other way to achieve this thing.

Member Avatar for tux4life
0
148
Member Avatar for abhimanipal

[code=c] union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("n%d", sizeof(u)); printf(" %d", sizeof(u.a)); printf("%d", sizeof(u.a[4].i)); } [/code] Hello People. I just came across this piece of C code. I have a couple of question The third printf statement gives me the …

Member Avatar for kvprajapati
1
110
Member Avatar for tien113

bad.c [CODE]#include <stdio.h> main(t,_,a) char * a; { return! 0<t? t<3? main(-79,-13,a+ main(-87,1-_, main(-86, 0, a+1 ) +a)): 1, t<_? main(t+1, _, a ) :3, main ( -94, -27+t, a ) &&t == 2 ?_ <13 ? main ( 2, _+1, "%s %d %d\n" ) :9:16: t<0? t<-72? main( _, …

Member Avatar for Salem
-1
551
Member Avatar for Pilot Boy

Well hello! I'm having problem with reading data from notepad.. So here is what I'm trying to do. etc.. I have notepad file "Doc" and in it there are few things: Level= 5 Cash= 100 And what I want from my program to do is to read Level and Cash …

Member Avatar for Pilot Boy
0
405
Member Avatar for nathanurag

[CODE] #include<stdio.h> void reverse(char s[], int i); main() { int i,c; char s[1000]; for(i=0;(c=getchar())!='\n';i++) { s[i]=c; c=getchar(); } void reverse(s,i); [B] //getting error in this line[/B] return 0; } void reverse(char input[], int n) { int i; for(i=n;i>=0;--i) { printf("%c", input[i]); } } [/CODE] i am writing a program to …

Member Avatar for nathanurag
0
315
Member Avatar for Zach101man

I need help on getting started with a simple program. I made the mistake of taking too long between classes and it has slipped my mind. Design and implement an abstract data type for a matrix of integers. Include a function that will multiply two matrices. Write a small driver …

Member Avatar for WaltP
0
54
Member Avatar for Adami

I wrote an Ansi C# code that finds the smallest number in a several unknown function calls. You can see the code, it is very clear. just need help with how to make the program to not ignore always the first number in the list of each argument list... and …

Member Avatar for Adami
0
121
Member Avatar for jonnybgood

Hi, I need your help. I'm searching for very tough C++ tests over the net. Can you send me links of such a tests. Thank you!!!

Member Avatar for Narue
0
118
Member Avatar for Ancient Dragon

The idea for this came from another thread in the C++ forum that wanted to duplicate the _getdelim() function that is supported by GNU compilers g++. I made one major change in that this version does not allocate new memory every time it is called, which is grossly inefficient. Instead, …

Member Avatar for Ancient Dragon
2
318
Member Avatar for Gonbe

Hello Daniweb, I'm trying to create a very simple shell for practicing purposes, but i'm a little bit puzzeled about the usage of execve, the function i use to execute a file. The code fragment underneath shows my usage: [CODE="C"] childPID = vfork(); if (childPID == 0) { execve(input.process, input.parameters, …

Member Avatar for gerard4143
0
273
Member Avatar for nathanurag
Member Avatar for Ancient Dragon
0
152
Member Avatar for zakir123

i want programme in c++ a car stand 3hours in 2$ then another car stand 24hours in 10$

Member Avatar for adcodingmaster
0
141
Member Avatar for Draculaboy1014

So I have this C code which is supposed to check if words from a input.txt are in a dictionary.txt document that I have created. Words in both texts are separeted by comas ej. dog,house,car@ and end with the "@" char. So far I have adjusted the code and it …

Member Avatar for gerard4143
-2
140
Member Avatar for Soileau

I am getting all sorts of incorrect type warnings when I compile the following code: [CODE]// hw1.c // Josh Soileau // 1/19/10 // Program: Asks / stores info on a bank // #include<stdio.h> int main(){ char name[25] = "blank", rating[25] = "blank", state[25] = "blank"; int lobbyists=0, prevemploys=0, number=0; double …

Member Avatar for WaltP
0
182
Member Avatar for Soileau

I am very very blurry about when to use pointers or not. I am writing a function (given below), and trying to pass in two variables, statenumber and state. I have them being passed in as chars, and not char *s. I get error messages both ways. I dont know …

Member Avatar for gerard4143
0
138
Member Avatar for nagajyothi

Hi! please tell what is the function intead of getdelim to work as getdelim in windows. because it is supported for windows envirnmnt na..

Member Avatar for Ancient Dragon
0
141
Member Avatar for adcodingmaster

My question is Y DLL? i know that it saves memory and many process can use 1 DLL file at a time blah blah blah...... but is there any task which can not b achieved without using DLL files?? Please reply in details.

Member Avatar for Ancient Dragon
-2
108

The End.