238 Posted Topics
Re: [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 … | |
Re: 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(){} | |
Re: [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 … | |
Re: [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 … | |
Re: [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 … | |
Re: [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 … | |
Re: 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 … | |
Re: [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 … | |
Re: [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 … | |
![]() | Re: 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] |
Re: [QUOTE=chandagondhali;996041]How to create classes & object?[/QUOTE] First read some book on C++ | |
Re: [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() … | |
Re: 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 … | |
Re: 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] | |
Re: [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 … | |
Re: [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: … | |
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 | |
Re: 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] | |
Re: 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. | |
Re: go through the program. U wil know where to modify. | |
Re: 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 … | |
Re: 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 … | |
Re: 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) … | |
Re: 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. | |
Re: [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 … | |
Re: [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 … | |
Re: 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 … | |
Re: [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); … |