15,547 Topics

Member Avatar for
Member Avatar for Gaiety

can i use statements like: int num; fread(&num,sizeof(num),1,stdin); fwrite(&num,sizeof(num),1,stdout); i tried this and debugged the code the variable is having the correct value. but that is not getting displayed. can't i use stdin , stdout in fread and fwrite.

Member Avatar for codeguru_2009
0
1K
Member Avatar for jhunluis

This program I wrote has the following error: (33,5):Declaration syntax error (64,2):Declaration missing ; [CODE]#include <stdio.h> #include <conio.h> int range1(int a); int range2(int b); int range3(int c); int range4(int d); int main() { int in, ctr, ctr1=0, ctr2=0, ctr3=0, ctr4=0, ctr5=30; for(ctr=1;ctr<=30;ctr++) { printf("Enter %d integer values within 1-200: ", …

Member Avatar for Salem
0
164
Member Avatar for TGeorge824

Hey Guys, sorry but i guess I posted a code snippet when I shouldnt've. That was my first daniweb thread. The program I'm trying to run checks to see if a number is perfect, abundant or deficient. It's perfect if its factors add up to the number(ie 6 = 3+2+1), …

Member Avatar for yellowSnow
0
93
Member Avatar for hoke

Using \x I can specify hexadecimal numbers in strings in C, but if I put \x00 then it interprets it as an instruction to terminate the string. As a result I can't express a hexadecimal number with 00 in it using a string! Is there some way around this?

Member Avatar for Ancient Dragon
0
589
Member Avatar for chathu12

Hello every one. I coded a program to seperate words from a file and want to input each seperated part to an array.But it doesnot work.Please help me!! Here is the code [code]#include<stdio.h> #include <string.h> #define max 100 int main() { FILE *f; char data[128]; char *p; int host=0; int …

Member Avatar for dkalita
0
159
Member Avatar for Samyx

Hi everyone, this is what I have to do: The method [code]makeWordList (char *fileName)[/code]. this method will take in a file name, read from the file and identify the words in the file. These words should be stored in a global array for use in the next method. The method …

Member Avatar for Salem
0
119
Member Avatar for TGeorge824

The program I'm trying to run checks to see if a number is perfect, abundant or deficient. It's perfect if its factors add up to the number(ie 6 = 3+2+1), deficient if the number is greater than the factors, and abundant if the factors add up to more than the …

Member Avatar for TGeorge824
0
98
Member Avatar for bernadlosini

The question given like this using the CreateProcess () in the Win32 API. In this instance, you will need to specify a separate program to be invoked from CreateProcess(). It is this separate program that will run as a child process outputting the Fibonacci sequence. Perform necessary error checking to …

Member Avatar for Sameer.coder
0
968
Member Avatar for sacredmaiden

Hi everyone, i'm new here, and also new in InfoTech education (i'm a freshman student) I don't really know what's the exact word for it, so it's pretty hard for me to search it in this forum but.... can anyone help me out? how can i use WHILE in reversing …

Member Avatar for Sameer.coder
0
115
Member Avatar for vivekarora

Hello Friends, We have a known problem in our hands: Allocate some memory, and get a pointer to that memory. Now, no one stops this pointer to perform memory overrun or underrun(i.e. writing before the allocated memory). I wish to implement 2 functions as MyMalloc() & MyFree(). When I use …

Member Avatar for vivekarora
0
206
Member Avatar for OneDreamCloser

hi all , i hope you can help me with the following : in types.h : [code=c] /* Structure of input buffer for each switch */ typedef struct InputBuffer *InputBufferPtr; typedef struct { struct List **fifo; /* Input fifos: one per output. */ void *traffic; /* Placeholder for traffic stats …

Member Avatar for Salem
0
129
Member Avatar for Grn Xtrm

Hello friends. I'm very new to C and am still learning how to do basic stuff. I got the code to work in C++ (which I'm much more fluent in) but I'm having trouble converting it to C code. [code=cpp] #include <iostream> using namespace std; double factorial( int n); int …

Member Avatar for Grn Xtrm
1
198
Member Avatar for Gaiety

Hello, i found two codes for finding out the height of the tree (this is what creating confusion for me which one is correct) 1. int height( BinaryTree Node t) [COLOR="Red"]{[/COLOR] if t is a null tree return -1; hl = height( left subtree of t); hr = height( right …

Member Avatar for Tom Gunn
0
114
Member Avatar for DoEds

I just found this example in my book. After running the program in will only ready the first line of my file. Ex. inside my file "PhoneBook.txt" Mine 12345678 Hers 1234567 Them 123456 It will only read "Mine 12345678" ignoring "Hers 1234567 and Them 123456" How will i'll make this …

Member Avatar for DoEds
0
111
Member Avatar for jralexander137

I'm trying to find the largest int in an array and then print it out to the screen. Here is what I have so far: [code=c]void LargeNumber(int numbers[], int k){ int len = k; int i = 0; int big_num = 0; for(i=0; i<len; i++) { printf("i is: %d\n", i); …

Member Avatar for dkalita
0
105
Member Avatar for splurchner

I wrote this small program for a class im taking, and its supposed to take an int n and a radix (int between 2 and 16) r and give me the number converted to the new base. It only has to go from decimal to other radix's. I run my …

Member Avatar for splurchner
0
188
Member Avatar for jralexander137

I'm a little lost when it comes to initializing a dynamic array. I am counting the number of integers that appear in a given text file and incrementing a counter which will then be used to set the size of the array. Here is what I have so far: [code=c] …

Member Avatar for Salem
0
163
Member Avatar for cristian.sorin

Hello. I have this simple program that open a file and read lines from it and print them to screen. #include <errno.h> #include <stdlib.h> #include <stdio.h> int main() { char line[4096]; FILE *fp = fopen("/root/Desktop/testfile","r"); if( fp == NULL ) { exit(1); } while(fgets( line, sizeof(line), fp ) != NULL …

Member Avatar for codeguru_2009
0
146
Member Avatar for Gaiety

Hello, I am working on tree stuff but i am very confused of Tree concepts and balanced trees , height of the tree. What is an expression tree? how to create the expression trees. Please request you to do the need.

Member Avatar for Tom Gunn
0
80
Member Avatar for ubi_ct83
Member Avatar for kvprajapati
0
174
Member Avatar for hket89
Member Avatar for jralexander137

I'm trying to scan a line from a data file(txt format) it just contains a line of ints ex. 3457983257892 I need to scan the line and get the total number of individual ints. Basically, 34563456 would total to 8. I'm not sure how to manipulate a while loop using …

Member Avatar for Salem
0
96
Member Avatar for Nathan Campos

Hello, I'm starting in the development under PocketC and i want to know if here in DaniWeb we have other users that are using the same software. Regards, Nathan Paulino Campos

Member Avatar for serkan sendur
0
73
Member Avatar for MrNoob

hello i m suppose to do this program which should pass array of ptrs to a structure intilise and put student[i] info in each array i did most of it but now i got problem coz i cant just pass address of structure since its an array of ptrs to …

Member Avatar for MrNoob
0
148
Member Avatar for ameneh_p

hi i want to get it's implementation as soon as possible. i will be thankful for your help. :icon_redface:

Member Avatar for mrnutty
0
153
Member Avatar for MrNoob

hello i m doing some function for saving a structure of some employee to text but i want to do it using ptrs to struct normally i tried first using ptr to struct in some main function to test some stuff abt it but i get runtime error [code] #include …

Member Avatar for yellowSnow
0
125
Member Avatar for Gaiety

Hello every one, I Request you to kindly provide me the description of Tree and its traversal meothds of using iterative. i tried for all recursive ones but this one i cant get. how to get back to the parents nodes when printing in inorder and post order methods. how …

Member Avatar for Tom Gunn
0
169
Member Avatar for geoffy0404

I am just starting out in C, i am doing this from what i remembered from the class i take and i just cant find whats wrong with this[CODE]#include <stdio.h> int main() { char lol[30] = ("hello everybody"); printf("%c", lol); return 0; }[/CODE] when i compile, i just keep getting …

Member Avatar for geoffy0404
0
76
Member Avatar for mrman208

I was wondering how if possible to get information from the internet and display it. Thanks, Mr. Man

Member Avatar for Salem
0
56
Member Avatar for zhinokin

hi to everyone... i will make a program about parenthesis checking and my prof said that we will not be using a stack for this. will you kindly help me to this.. aside from stack can you help me on what to use.?.

Member Avatar for Salem
0
91

The End.