238 Posted Topics

Member Avatar for Eusha
Member Avatar for JasonHippy
0
1K
Member Avatar for raigs

[QUOTE=raigs;1029871]How to: 1. Buffer output ? 2. Get its size ? 3. Print the buffer ? [CODE]#include <stdio.h> int main(void) { printf("Tons of printf lines\n"); // 1. Somehow buffer the output up until this point printf("The size of the buffer is: %i\n", SIZEOFBUFFER); // 2. Get and print the size …

Member Avatar for raigs
0
4K
Member Avatar for ravenrider

where is the memory allocation for [B]course::classD[/B]. line #32: allocate memory for classD like u did for [B]course::dept[/B]

Member Avatar for ravenrider
0
101
Member Avatar for komrul_raja009

Adding to crazyboy: It can be generalized as follows: [code] expr?expr1:expr2; [/code] MEANS [code] if(expr) expr1; else expr2; [/code]

Member Avatar for dkalita
0
68
Member Avatar for arsh_arsh

i guess u have not initialized [B]iRowCount[/B] and [B]iNoOfCol[/B]. Also note that [B]iRowCount<=MAX_ROW and iNoOfCol<=MAX_COL[/B]. Otherwise u will get array outofbound error (or seg fault)

Member Avatar for arsh_arsh
0
86
Member Avatar for jmoran19

Below is an idea that u can apply. It is not the complete implementation. U can use this approach may be with some minute modification. [CODE] typedef enum {_INT, _FLOAT, _OTHER} DataType; typedef struct { DataType dataType; union { int intData; float flData; } data; }Data; DataType getType(char *) { …

Member Avatar for jmoran19
0
113
Member Avatar for aznswti85

[CODE] name2 = givenLast + “,” + givenFirst; [/CODE] givenLast and givenFirst are not initialized.

Member Avatar for IT seeker
0
162
Member Avatar for Ismailworking

[QUOTE=Ismailworking;1027992]Hi . i am using C++ editor to write my C code. when i press Ctrl+F9 , the output screen comes and goes without stopping for a while. Please note that i have included "#include<stdio.h>" and i am using "getchar()" function do stop the screen.[/QUOTE] If you are using turbo …

Member Avatar for ankur_
0
10K
Member Avatar for Ineedhelpplz

Just explore this site a bit. Infix to postfix conversion has been discussed earlier in many threads.

Member Avatar for Ineedhelpplz
0
207
Member Avatar for edwar

1> 16 posts and yet no code tag 2> U are comparing integer with a node pointer in the following line: [CODE] for(i=1; i<currentNode; i++)/*i : integer, currentNode : a pointer..............................ERROR IN HERE*/ { cout<<i<< getSpatie(currentNode->word)<< currentNode->numTimesAppear<<endl; /*remaining codes*/ [/CODE] I think u are looking for something like [CODE] for(i=1; …

Member Avatar for edwar
0
358
Member Avatar for NICEGUY123
Member Avatar for crystality

u haven't initialized the variables [B]myLineNumbers and temp[/B] and u are trying to operate on it. Initialize them in the constructor as: [CODE] myLineNumbers = new Queue<int>(); temp = new Queue<int>(); [/CODE]

Member Avatar for dkalita
0
356
Member Avatar for Ashishinani1756
Member Avatar for crystality

[QUOTE=noey699;1028141]i am not sure but it might be friend ostream& operator<< (ostream &, const GrabStuff&); needs a space between operator and << so it would be friend ostream& operator << (ostream &, const GrabStuff&);[/QUOTE] That is not an issue. I dont know why that error is coming though but I …

Member Avatar for crystality
1
735
Member Avatar for Qmage

1> Once the default case is invoked, the flag [B]rightanswer [/B]is set to [B]false[/B] and it is [B]never reset to true [/B]so that the loop ends. 2> U are trying to assign a string using = operator. Use [B]strcpy()[/B].

Member Avatar for Qmage
0
89
Member Avatar for Gem74

[B]error 1:[/B] [code] /*you are writting*/ secretType () //default constructor {name = " "; age = 0; weight = 0; height = 0;} /*remember your 'name' var was like: char name[10]*/ /*but you are assigning it a value which is an address to a string of size 2 i.e. " …

Member Avatar for dkalita
0
100
Member Avatar for Dr EUU
Member Avatar for swolll
Member Avatar for StaticX

code snippet 1: line #24 u are not printing the value. [CODE] /**do it as follows/ cout << "Your number doubled is: " <<number<< endl; [/CODE] code snippet 2: line #4 sysntax error [CODE] /*correct form is*/ class Number{/*() not required*/ } [/CODE]

Member Avatar for mikiurban
0
109
Member Avatar for seoudi

[QUOTE=seoudi;1024119]Create a program that displays a pyramid , square and a triangle using the multiply character “*” as follows: welcome to c++ shape for pyrasmid sqyare trinagle[/QUOTE] In C++ u have so many features available such as: [B]cout[/B], [B]for loop[/B], etc. Use them along with your [B]brain[/B]. That will help …

Member Avatar for ashwini jadhav
0
86
Member Avatar for ankur_

[QUOTE=ankur_;1023933]How can we get the last error occured in linux. suppose there is a connect() func error in that case how to get the error that occured.[/QUOTE] use [B]gdb[/B] to get to the particular statement where the error ocurred.

Member Avatar for dkalita
0
121
Member Avatar for skumar.idea

may be u can try this [CODE] char cmd[200]; strcpy(cmd, "ls "); strcat(cmd, pattern); strcat(cmd, " "); strcat(cmd, "> itemlist.tmp"); system(cmd); /*parse the file 'itemlist.tmp' to get all the matching items*/ /*u can use the 'file' command to get info about the item*/ /*or instead of ls u can use …

Member Avatar for dkalita
0
80
Member Avatar for flyballonfly

[QUOTE=flyballonfly;1023303] Is there any way to dynamically assign the length of the arrays depending on the input? That was what I was trying to do with the code below. [CODE] fscanf(infile,"%d", &numSegs); char arrOwner[numSegs]; char arrLength[numSegs]; [/CODE][/QUOTE] use malloc() [CODE] char *arrOwner char *arrLength; fscanf(infile,"%d", &numSegs); arrOwner = malloc(numSegs); arrLength …

Member Avatar for dkalita
0
86
Member Avatar for hmortensen
Member Avatar for hmortensen
0
148
Member Avatar for Reprise

i think u should do something like [CODE] class cstring { char *str; public: cstring(const char *str) { this->str = (char *)malloc(strlen(str)+1); strcpy(this->str, str); } cstring(const cstring &cs) { this->str = (char *)malloc(strlen(cs.str)+1); strcpy(this->str, cs.str); } bool operator>(const cstring &b) { if(strcmp(str, b.str)>0) return true; return false; } /*some more …

Member Avatar for xxjay922xx
0
94
Member Avatar for Phil++

it would be like [CODE] class Person { /*members*/ public: void setName(); /*and more*/ }; class Admin:public Person { /*more members*/ }; /*u can use them as*/ Admin adm; adm.setName("Testname"); [/CODE]

Member Avatar for dkalita
0
149
Member Avatar for agr.pallav

[QUOTE=agr.pallav;1021369]i would like to know the way we can make user enter a number in a menu reply perhaps so that he doesnt have to press the enter key...........i.e. the program automatically proceeds with the give value and doesnt wait for an enter key to be pressed. its easy in …

Member Avatar for Tom Gunn
0
163
Member Avatar for josephkamanzi

are u looking for assignments? If so u can try implementing the complex data structures like BST, avl tree, etc. U will will get to learn many thing out of it.

Member Avatar for Grn Xtrm
-1
46
Member Avatar for IFEEL
Member Avatar for TomMan

>Firstly, why is this? It's because u are defining dictionary in more than one place Once in wermz.cpp and once in main.cpp >Secondly, why does it say .bss+0x0 and not the line number? It's the object module which is a binary file and hence it doesn't have a line number

Member Avatar for dkalita
0
261
Member Avatar for venkat arun

[QUOTE=venkat arun;1003964]Hello, I am trying to make a compiler. Don't ask me why because I am making it for fun and experience. I have made a lexical analyser in c++ (I didn't use flex). I now want to make the parser for which I want to use Bison. But I …

Member Avatar for Nick Evan
0
131
Member Avatar for Nicholas_Roge

follow the link [url]https://computing.llnl.gov/tutorials/pthreads/[/url]

Member Avatar for dkalita
0
77
Member Avatar for vvilladolid

get the digits and their position and print accordingly. e.g. say 1305. 3 in location 100 hence print "three hundred". proceed accordingly for the rest. [COLOR="Red"]DONT EXPECT READY-MADE CODE HERE[/COLOR]

Member Avatar for mrnutty
0
187
Member Avatar for dkalita

Hi I have joined this community one month ago and have become fan of it. This is the first and only forum where I registered and active since joining. About myself: I am Dharmendra kalita, from Assam, (India). Currently doing as a trainee in GE Healthcare bangalore(India). I have passed …

Member Avatar for dkalita
0
99
Member Avatar for 50701735

[QUOTE=50701735;1020119]please tell me about some my questions. if (we have a pointer *tmp)-> that my goal is assign that pointer for another pointer ** temp ; so ,how do we assign for right sytax.[/QUOTE] are u asking something like [code] int y; int *p; int **pp; p = &y; pp …

Member Avatar for dkalita
0
77
Member Avatar for comput

This is what I guess it means prev==0 means: Last entry to the bridge was from the NORTH prev==1 means: from SOUTH [CODE] void enter_bridge_north() { num_waiting_north++; //add yourself to the waiting queue while (on_bridge || (prev == 0 && num_waiting_south > 0)) /* *if someone on bridge *OR *previous …

Member Avatar for dkalita
0
1K
Member Avatar for OSiRiSsk

use a flag for that as follows [code] #define FALSE 0 #define TRUE 1 void VymazBiele() { int c; int start= TRUE; while ( (c = getchar() ) != EOF ) { if (isspace(c)) { if(start==FALSE) putchar(' '); while ( (c = getchar() ) != EOF && isspace(c)) {} } …

Member Avatar for OSiRiSsk
0
542
Member Avatar for gretty

U have not initialized your list. In line #17 do [CODE] node *list = NULL; [/CODE]

Member Avatar for dkalita
0
93
Member Avatar for pocku

when u include a file in <> brace like follows [CODE] #include <mutex.h> [/CODE] it looks in the include directory. But your file mutex.h is in your current directory. To include such file u have to do it using "" [CODE] #include "mutex.h" [/CODE]

Member Avatar for pocku
0
188
Member Avatar for aamaikusa
Member Avatar for panagos

do something like: [CODE] typedef struct { int x; int y; }coord; /*store the coordinate of the maze as follows in an array*/ coord maze[]={{1,1},{1,2},{1,3},{1,5},{2,3}, {1,4}}; int mazesize = sizeof(maze)/sizeof(coord);/*hence u won't need to count how many coords are there manually*/ void drawMaze()/*draw the maze*/ { int i; for(i=0;i<mazesize;i++) { …

Member Avatar for dkalita
0
223
Member Avatar for jalalsad

I didn't get what u are trying to do. But let me explain a bit of inheritance [CODE] class Base { /*members*/ }; class Derived:public Base { /*members*/ }; Base *bptr = new Derived(); /*or if u need only base object*/ bptr = new Base(); [/CODE] But using bptr u …

Member Avatar for jalalsad
0
100
Member Avatar for Web_Sailor

write your own functions for validation. e.g. [CODE] bool isnum(char *str) { if(str==NULL) return false; while(*str) { if(!isdigit(*str)) return false; str++; } return true; } [/CODE]

Member Avatar for Web_Sailor
0
142
Member Avatar for Dewey1040

the errors are pretty clear i guess. There is nothing that seem to be complicated about the error messages.

Member Avatar for Zjarek
0
130
Member Avatar for jt241

[CODE] Matrix & operator+(const Matrix &, const Matrix &); [/CODE] this is not the prototype for overloading binary operator. The proper is [CODE] Matrix & operator+(const Matrix &); [/CODE] The other operand for the operation is the calling object. say [CODE] Matrix a, b, c; c = a+b; [/CODE] here …

Member Avatar for dkalita
0
192
Member Avatar for merse

[CODE] /*original function*/ void my_fun(int); /*pointer to function*/ void (*funPtr)(int); /*assigning the function to the pointer*/ funPtr = my_fun; /*calling the function using pointer*/ (*funPtr)(3); //OR funPtr(3); [/CODE] checkout the link [url]http://publications.gbdirect.co.uk/c_book/chapter5/function_pointers.html[/url]

Member Avatar for Grn Xtrm
0
170
Member Avatar for drjay1627

[QUOTE=drjay1627;844323] client [code] string s = "Who are you?"; /* transfer data */ write ( sockfd, s, s.size() ); //--compile error nread = read ( sockfd, buf, SIZE ); write ( 1, buf, nread ); close ( sockfd ); exit (0); [/code] there is a compiling error in the client. …

Member Avatar for dkalita
0
242
Member Avatar for Web_Sailor

regarding increasing efficiency: Every time u invoke getline() method to read something from the file. If the file have say 10,00,000 words u are executing getline() that many time. Now getline() involves file-read operation which is a time consuming task and hence it decreases the efficiency. What u can do …

Member Avatar for dkalita
0
146
Member Avatar for dabeechman

1> [COLOR="Red"]DO PROPER INDENTATION TO YOUR CODE.[/COLOR] 2> line #7 It should be an assignment(=) statement and not a comparison(==).

Member Avatar for dabeechman
0
88
Member Avatar for Ineedhelpplz

[code] if(number = 0){} [/code] what do u expect it do do? That is an assignment statement. Read how to compare numbers..... U are doing [code] number = number%16; [/code] u are getting the least significant digit by that and u are loosing the remaining number. U should have done …

Member Avatar for Ineedhelpplz
1
384

The End.