15,551 Topics
| |
You are required to write a C program that accepts two decimal integers, say d and r. You may assume that the first decimal integer d is nonnegative and that the second decimal integer r which represents the radix, will be one of 2, 3, 4, . . ., 15, … | |
Hi, for an assignment I have to do, we have to made a Stack and Queue, and read data from a file and add to queue and push onto the stack. Well, I made an array implementation of a stack that works fine, but the array implementation of the Queue … | |
My unit doesn't teach this so I am unaware about the correct syntax to go about what I want to do. I have hit google but have produced no answers to my specific problem. So here we go. I have a series of nested structs. Is this possible that instead … | |
When I try to compile the Quake 2 Source code from the if Software website, I get this error: ------ Build started: Project: quake2, Configuration: Debug Alpha Win32 ------ Compiling resources... Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1 Copyright (C) Microsoft Corporation. All rights reserved. .\win32\q2.rc(10) : fatal error … | |
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. | |
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: ", … | |
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), … | |
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? | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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); … | |
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 … | |
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] … | |
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 … | |
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. | |
Hi all, its me again.can i have a function that return a double array? | |
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 … | |
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 | |
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 … | |
hi i want to get it's implementation as soon as possible. i will be thankful for your help. :icon_redface: | |
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 … |
The End.