238 Posted Topics

Member Avatar for gemgirl1972

[QUOTE=gemgirl1972;997601]Hello All, how can I create a member function for a class that is reading from a txt file, which is reading computer network addresses and names for the addresses. I was guessing they need to be string and 4 ints data type. Example of data.txt file input 111.22.3.3 "green …

Member Avatar for dkalita
0
201
Member Avatar for CRz315

u have to add a default constructor in the class to continue with your code. Default constructor is created by default if u don't declare any constructor but if u declare some constructor then its not done. add the following in the Employee class Employee(){}

Member Avatar for dkalita
0
94
Member Avatar for plobby

[QUOTE=plobby;995690]Hi -- After lots of searching I cant seem to find an answer (well one that I understand at least..) I want to make the variables wobstacle, waisle, and wturn ONLY numbers where a user cannot input a letter and break the program. I was thinking of something along the …

Member Avatar for mrnutty
0
139
Member Avatar for Talguy

[QUOTE=Talguy;995923]I have been posting a bit about my current side project, a scripting language interpreter. I have gotten past my getline error I talked about in a previous post and am now trying to get the results from the script. I created a map of all the labels in the …

Member Avatar for dkalita
0
67
Member Avatar for osei-akoto

[QUOTE=osei-akoto;952724]Please can somebody explain to me whether sometimes the strrev function fails or not. I was giving an assignment to write an application that can detect whether an entered word from the keyboard is a palindrome or not. After accepting the string and tried to use the function from the …

Member Avatar for yellowSnow
0
632
Member Avatar for zeeli

[QUOTE=zeeli;998588]Hi, I am a total newbie when it comes to makefiles and now I'm in a need of one. I have a directory structure as follows: [CODE]Project_root/Makefile Project_root/src/ Project_root/src/widgets/ Project_root/include/ Project_root/include/widgets/[/CODE] Each directory contains multiple source/header files. I need to build a shared library out of this directory and perhaps …

Member Avatar for dkalita
0
135
Member Avatar for pula.alt

u have some logical problems [CODE] for(int i=0; i<15; i++) { Makers[i]=new char[256]; Models[i]=new char[256]; //Welcome screen and instructions Greeting(); //Prompt to continue through program while (true) { /*your code*/ } ............. } [/CODE] look at it properly u have allocated memory only once and u have written a while …

Member Avatar for dkalita
0
281
Member Avatar for sethuramang

[QUOTE=sethuramang;998043]Hello, I'm trying to implement a program in C to read and display data from a text file, assign certain values to pre-defined variables and continue reading in the data. And example format of the data file is: --------------------------------------------------------------------------------------------- *** General Comments *** .... ***... .... 5 125 3 .6167 …

Member Avatar for dkalita
0
93
Member Avatar for adi.shoukat

[B]recv()[/B] blocks untill it gets something to read from the inputted socket. If its blocked clearly means that there is no data to be read. Check your connection both from server side and client. Check whether the server is connected to the particular client or not and also in the …

Member Avatar for dkalita
0
268
Member Avatar for arcticM

can u post your program or mail it to me so that i can have a look at it to [B]dharmendra.kalita@ge.com[/B]

Member Avatar for Dave Sinkula
0
112
Member Avatar for chandagondhali

[QUOTE=chandagondhali;996041]How to create classes & object?[/QUOTE] First read some book on C++

Member Avatar for siddhant3s
0
63
Member Avatar for jdam7459

[QUOTE=jdam7459;995960]I am having problems with traversing a parce tree. I need to do an in order traversal recursively. Here's the class's private section... [CODE] template <class data> class BinaryTree { private: struct tNode { data info; tNode *left; tNode *right; }; tNode *root; public: }; [/CODE] I'll be calling inOrderTraversal() …

Member Avatar for jdam7459
0
98
Member Avatar for Gaiety

what he says is correct. U r only checking for the root. yor function should be something like [CODE] int isbal(BST_t *root) { if( root ) { hr=height( root -> right); hl=height( root -> left ); if(!((hr - hl) >= -1 && (hr - hl) <= 1)) return 0; else …

Member Avatar for dkalita
0
109
Member Avatar for magicor

use [B]fork() [/B]to create a child process and in the child process use [B]execv() [/B]to call the background process. read about fork() and execv() and their usage. it looks like [CODE] int child; child=fork(); if(child==0) { execv(............); } else { /*current process*/ } [/CODE]

Member Avatar for dkalita
0
88
Member Avatar for kyumi419

[QUOTE=kyumi419;995894]how to make a program that will ignore the highest value and the lowest value, but will get the average of the remaining values.. for example: there are 6 inputted grades, then the 4 middle values should get their average.. and will ignore the highest and lowest..? :)[/QUOTE] write a …

Member Avatar for dkalita
0
129
Member Avatar for gcardonav

[QUOTE=gcardonav;995936]Hi: I am trying to create a loop for a code. My loop is supposed to find all the combinations using the numbers 1 and 0 depending on the length of my string. For example if I set up my string to be 3 then the program should give me: …

Member Avatar for dkalita
0
184
Member Avatar for dkalita

Hi Can anyone help me in extracting all the tables and its contents that are present in a MS word document using c++ or C

Member Avatar for dkalita
-1
114
Member Avatar for johndoe123

or u can do it as [CODE] int random(int a, int b) { srand(time(NULL)); int r = rand()%2; if(r==0) return a; else return b; } [/CODE]

Member Avatar for Nick Evan
0
10K
Member Avatar for geoffy0404

i think u should read the C syntaxes for arithmetic operation first. Thats not a way to do arithmatic operations in C. U will find them in any book on C.

Member Avatar for chesspest
0
116
Member Avatar for markrezak
Member Avatar for dragonbone

hi I think your insertion logic is not correct. While inserting u are checking the _sysMatch symbol to be same. If the symbol match and particular side(left/right) is not null u are recursively calling the insert function with the same _sysMatch sysmbol for checking, but then that particular symbol wont …

Member Avatar for dkalita
0
218
Member Avatar for movie55

int T[1001][4001]; needs a huge memory that is equeal to 1001 * 4001 * 4 [sizeof(int) is 4 in linux] that equeals to 4,000,000 * 4 byte approx = 16,000,000 byte = 16,000 KB (approx) = 16 MB (approx) due to this size only your system is giving a segmentation …

Member Avatar for dkalita
0
74
Member Avatar for TGeorge824

yes u can declare such function. But i would suggest u to declare your node as struct node{ struct grocery* list; struct node *next; }; u can allocate memory to it dynamically as [CODE] node x; x.list = (struct grocery *)malloc(5*sizeof(struct grocery)); [/CODE] and u can access them as *(x.list) …

Member Avatar for dkalita
0
125
Member Avatar for scootscoot

u can write a display function which displays all the values present in the current buffer e.g. [CODE] void displayBuffer() { //code to display the contents of the valid buffer// //i.e. from head to tail...// } [/CODE] u can use this function after any buffer operation such as requestNextBuffer(...) etc.

Member Avatar for dkalita
0
144
Member Avatar for priyabalu87

[QUOTE=priyabalu87;987988]program needed[/QUOTE] Hi please find the code below. i have tested the program in linux. it might give some minor error in turbo-c but i hope u can correct those. [CODE]#include<stdio.h> void drawPascalTriangle(int rows); void getRow(int *prevRow, int prevRowSize, int *row); void copyRow(int *prevRow, int *row, int rowSize); void dispRow(int …

Member Avatar for dkalita
-1
141
Member Avatar for hoke

[QUOTE=hoke;981994]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?[/QUOTE] no …

Member Avatar for Ancient Dragon
0
613
Member Avatar for chathu12

i would also like u to read the strtok() manual first. If u are working in linux just type : man strtok another thing is that u are trying to strore an array of string to an array of character. u have to declare the array to store the words …

Member Avatar for dkalita
0
162
Member Avatar for jralexander137

[QUOTE=jralexander137;986332]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=1; i<len; i++) { printf("i is: %d\n", i); …

Member Avatar for dkalita
0
107