15,551 Topics
| |
Suppose we have two array inorder and preorder containing the elements in the said format. Using these two arrays how can i generate the binary tree?? Any help on the algorithm to be followed will be highly appreciated. For eg: inorder is : 2 3 4 5 6 7 8 … | |
Hello All I am Posting after a very Long time because of Having a problem :) The Problem is I want to Convert a String on UNKNOWN size to character array. Explanation: I have a file in JAVA that sends some string through JNI, I collect that String in C. … | |
I'm using gcc to compile and I need to be able to run it by doing ./test 7 10 + this is part an attempt of a Reverse Polish Notation calculator for one of my computer classes. My program works if I put it in quotes passing the sequence in … | |
hi, i downloaded the existing twofish algorithm from bruce schiener's website but i am having trouble compiling it i.e making it run. can some one plz help me. | |
Hey everyone I was wondering if anyone had any tips or methods for me to better my programming in C. I know I have to practice problems from my book but are there any other ways to better my code writing skrills :D thank you. | |
Hey all. I'm having a bit of problem with structs. Say we have a struct comprised of some strings and ints.One of the strings is a keycode,which is used for hashing.So my program reads from a file some information,creates a struct and using that keycode it places the struct on … | |
I'm new at C coming from java but I'm learning it in one of my college classes and so far it's a nightmare anytime I write a program with it :'(. I'm writing a Reverse polish notation calculator and I'm using gcc as my compiler. I want to be able … | |
This is a two part program that I i had someone help me do but I need it transfered to simple c (printf and scanf ). If someone could help that would be great. 1) //Header file section #include<iostream> #include<cctype> using namespace std; void main() { char character[6],ch; int count=0; … | |
Doing an assignment to create a struct that holds keywords and then is used with a binary search to counter the total keywords in a program. Below is my code and below it is the errors i get when I attempt to compile it. First question is what is wrong … | |
Hi friends! What is the difference between these two definitions of variables? [CODE]const char *msg; char* const msg;[/CODE] thanks in advance) | |
Is there a usb_reset() version in Winusb? I've been researching what function to use in order to reset the usb device. I tried WinUsb_SetPipePolicy and passed RESET_PIPE_ON_RESUME as the policy type but I think this is not the right function that corresponds to the usb_reset() of libusb which resets the … | |
Hi mates!) If somebody can - please explain me - what does mean "[U]the lowest[/U]" in this context - [QUOTE]The open() function shall return a file descriptor for the named file that is [B][U]the lowest[/U][/B] file descriptor not currently open for that process.[/QUOTE] the QUOTE is from here - [URL="http://pubs.opengroup.org/onlinepubs/009695399/functions/open.html"]http://pubs.opengroup.org/onlinepubs/[/URL] … | |
How can I convert an unsigned int to a signed int using only bitwise operators? | |
What is wrong with my fread() [CODE]#include<stdlib.h> #include<stdio.h> #include<math.h> double stdDev(double avg, double x[]) { double stdDeviation; double diff; double Sqdiff; double sum=0; int i; for(i = 0; i<50; i++) { diff=x[i]-avg; Sqdiff=pow(diff,2); sum+=Sqdiff; } stdDeviation=sum/avg; return sqrt(stdDeviation); } double maximum(double x[]) { int i; double max; max=0; for( i … | |
globals.h [CODE] #ifndef _globals #define _globals #define DATA( L ) ( ( L ) -> datapointer ) #define NEXT( L ) ( ( L ) -> next ) typedef enum { OK, ERROR } status ; typedef enum { FALSE = 0 , TRUE=1 } bool ; typedef void *generic_ptr … | |
Program is suppose to convert binary to hex.. it says that i need a class/struct/union to the left of ".substr" but im pretty sure convert should be working.. [CODE]#include <iostream> #include <string> using namespace std; int main () { string convert [8]; string bin[16]= {"0000", "0001","0010","0011","0100","0101","0110","0111","1000","1001","1010","1011","1100","1101","1110","1111"}; string hex[16]= { "0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"}; … | |
I really need to find out the correct syntax for passing a two dimensional array. | |
I am developing a network chat application, I am using Winapi, my main window is a dialog (created from a .rc file). I am looking into a way of doing an text box where my outuput text can be like this: [QUOTE] [COLOR="Green"]Welcome to ##### chat server![/COLOR] [COLOR="Red"]Person1[/COLOR] says: Hi … | |
[CODE]void maximum(double *max, double x[]) { int i; for( i = 0; i<100; i++) { if(max < x[i]) max=x[i]; } }[/CODE] Why isnt this working Im probrably missing one syntaz that i cant think of at the moment Thank u | |
if anybody can help me with this code...plz [CODE]#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <string.h> void * scrambleArr(void * arr, int numElem, int elemSize,int (*func)(void*)); int func(void *x); void main( ) { int a[7]={1,2,3,4,5,6,7}; int i; int *p = NULL; p = scrambleArr(a, 7, sizeof(int),func); for (i = 0; … | |
I have to read in a file and do dot product calculations on two arrays but I get an error whenever I try to run it. Here is my code, [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int main() { FILE* input; FILE* output; int product=0; int length=0; int* … | |
i'm working on this program to 'read an array(int and float values) from a file and then print it out on the screen'....the i/p data file is looks like this #lat lon B s date X v 60.97 56.10 26.50 33.389 03 07 02 24.00 4 60.36 53.58 28.90 35.731 … | |
how can i parse between blank lines in a file to separate paragraphs between the white lines? | |
This program is to count the number of words,vowels and consonants of a string.Here is my code.Please post your comment.I do not know whether I need to change anything. [CODE]#include <stdio.h> int main() { char a,b =' '; int vowel=0,c=0,count=0; printf("Please press '*' to terminate.\n\n"); while(scanf("%c",&a)==1) { if(a=='*') break; else … | |
this is a simple code to test whether a number is prime or not...i dont know y it is taking this much time to execute...can ne1 tell where m mistaking?? heres my code [CODE] #include<stdio.h> #include<math.h> int main() { int a,n,prime,l=2; printf("Please enter a positive integer.\n"); printf("To end the program … | |
[COLOR="Green"]Trying to take input from user, put it in array and do the sorting[/COLOR] The code is: [CODE] #include <stdio.h> #include <conio.h> #include <stdlib.h> class Sort { static int array[5]; static int index; static int i; public: void insert(int num) { array[index] = num; index++; } int sortarr(const void *x, … | |
radixsort.c [CODE]/**************************************************************************************/ /* Radix Sort of integers numbers using polymorphic linked lists. */ /**************************************************************************************/ #include <stdio.h> #include "list.h" #include <stdlib.h> #include "numberinterface.h" #include <math.h> void static refill( int A[] , list Bins[] ) ; int static getdigit( int number, int position ) ; int main( int argc, char *argv[] ) … | |
Hello, I have two very simple questions. 1. I want to use fgets(text, MAX_WORDS, stdin) to read in a string file, where my array is text[MAX_WORDS]. But is there a way to make stdin a pointer instead to a 2nd array which can be a buffer? 2.Whats the difference between … | |
Hi. When I was looking at the header files of c library such as malloc.h, I saw that it defines some functions inside the struct (Function Pointer) and other functions outside, so my question is, why sometimes people defining function inside the struct and sometimes outside? Thanks -- Mark | |
can u tell me about this how can i do product of2 arrays in turbo c ?? are u have solution of this problem ?? if you have then answer me with example. |
The End.