Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
Ranked #4K
~6K People Reached
About Me

I'm an IT Trainer with a reputed company in India. Subjects I deal mainly are C++, Computer Networks, Perl. Over 3 years of experience in training fresh graduates and corporates as well.

Favorite Tags
Member Avatar for Gernicha

Hey everyone!! I am having trouble printing the whole of a multidimensional char array. [CODE] #include <iostream> using namespace std; int main(){ char array [5][10] = {"---------", "| |", "| |", "---------"}; cout << array << endl; system ("pause"); return 0; } [/CODE] It just gives me random numbers and …

Member Avatar for Gernicha
0
181
Member Avatar for mrinal.s2008

I was a C++ trainer for 3+ years and now am a developer with a software company. Last week, i had to undergo a C++ test on [url]www.brainbench.com[/url], as a part of my company's internal assessment. I scored 3.5 in the test (I'd gone unprepared at all). Can someone please …

Member Avatar for jwenting
0
110
Member Avatar for NvIs

My professor gave us an assignment to Convert the following 2 numbers to binary, octal and hex. 3.567, 0.032432 which would be easy if the numbers given weren't in decimals. I'm using the % operator and that can't be used by float... I'm lost. Can someone give me an idea …

Member Avatar for NvIs
0
121
Member Avatar for stemiros

Hi, I have a list of base types which stores multiple derived types. The following code shows a simplified setup. [CODE]#include "Base.h" #include "DerivedA.h" #include "DerivedB.h" #include <iostream> #include <list> void main() { std::list<Base*> base; std::list<Base*> *basePointer = &base; for (int i = 0; i < 10; i++) { basePointer->push_back(new …

Member Avatar for mrinal.s2008
0
2K
Member Avatar for mrinal.s2008

Hi, the code analysis tool we use gives below warning for the functions in which memset / memcpy is used "The function writes outside the bounds of dup on line 303, which could corrupt data, cause the program to crash, or lead to the execution of malicious code." could someone …

Member Avatar for Fbody
0
219
Member Avatar for mrinal.s2008

Hi, In the code snippet below, I tried to write the contents of a vector to a file using ostream iterator. However, when I try to read the contents of the file using istream_iterator, there is a problem. When the istream_iterator object is initialized using ifstream object fin, the istream_iterator …

Member Avatar for mitrmkar
0
294
Member Avatar for mrinal.s2008

Hi, While writing program for making a member function of one class a friend of another, VC++ is shooting two errors. The entire code is split across five files, 2 headers for two classes, 2 .cpp for the class members' definitions and 1 containing main() function. The headers are as …

Member Avatar for Fbody
0
190
Member Avatar for mrinal.s2008

Hi, I'm able to write a copy constructor for a class which contains pointer as a data member. However, when I have a reference as a data member, the copy constructor does not help, i.e. when I change that member for one object, the change is reflected in another one …

Member Avatar for JasonHippy
0
1K
Member Avatar for mrinal.s2008

Hi, While trying a program from "C++ Primer 3rd Edition" by Stannley Lippman, I encountered with following two errors. 1. The book says that the header file fstream also includes the header iostream, so including just fstream will do. But g++ complained about cout, cin and cerr despite having fstream …

Member Avatar for William Hemsworth
1
317
Member Avatar for mrinal.s2008

Hi, I have a header file in which I declare a class. A member function foo() is declared as inline. In another .cpp file, I define the function foo(). I create an object in main() (in another .cpp file) and invoke the foo() using that object. When I compile the …

Member Avatar for Nick Evan
0
80
Member Avatar for tomtetlaw

I am trying to initialize a vector inside a class's constructor, and I want the vector to be of type 'this' [code]std::vector<this>[/code] didnt work, [code] void* type = this; std::vector<type> [/code] that didn't work either, is there any other way to do it?

Member Avatar for jencas
0
229
Member Avatar for nustian

dear all plz i want help in this program can anyone do it...... Question: Derive a class from long_int class and add a member function "multiply" in the derived class to multiply two long_ints using the add member function already defined. multiply should work like this 2*3 = 2+2+2 (adding …

Member Avatar for nustian
0
81
Member Avatar for npd_ddit

main() { float a=0.7; if(a<0.7) cout<<"true" ;else cout<<"false"; } problem---> it prints true ..... when 0.7 is replaced everywhere with 0.8 it displays false again with 0.9 , it displays true.. typically only for 0.7 and 0.9 it gives different answer ,then the conventional logical answer..why so??

Member Avatar for npd_ddit
0
119
Member Avatar for mrinal.s2008

Hi, I have some questions on vector. Please consider the code below. I use g++ compiler on Linux. [CODE=c++] #include<iostream> #include<vector> using namespace std; class Sampler { int a; int b; }; int main() { vector <int> vec1; vector<float> vec2; vector<Sampler> vec3; cout << sizeof(vec1) << " " << sizeof(vec2) …

Member Avatar for jencas
0
100
Member Avatar for tomtetlaw

I'm learning c++ at the moment, and i just learnt about classes, so i decided to make a text game with a badguy and player class, and i was wondering how to refer to other classes variables(like this.health) from other classes. and wether you have to create an instance of …

Member Avatar for sid78669
0
166
Member Avatar for tomtetlaw

Hi all, I am making a text game in c++ and i am trying to get the player's attack to ba a random number between 1 and 7, but when i try to compile it, it gives me this error: 49 C:\Documents and Settings\Games\Desktop\C++ Tutorial\Combat\main.cpp void value not ignored as …

Member Avatar for Narue
0
289
Member Avatar for mrinal.s2008

Hi, I'm writing a template class as below. Trying to add a funtion to browse all the elements of an instance, that needs a vector iterator. When I compile the code getting a list of errors. Two of them typically draw my attention. The Error reads [B][COLOR="Red"]error:[/COLOR][/B] dependent-name ` std::vector<T,std::allocator<_CharT> …

Member Avatar for mrinal.s2008
0
205
Member Avatar for Dannielf

I'm doing a program that shows which tickets have been sold for an auditorium. I am a beginner to c++ so I am not sure how I can do the following: a) Allocate an input with a character (e.g. when I enter 'A10' .. how do I allocate 'A' to …

Member Avatar for mrinal.s2008
0
90
Member Avatar for Se7Olutionyg

[CODE]#include <iostream> #include <cmath> using namespace std; const float G = 32.17; // function declaration float caltime ( float,float, float ); float calheight ( float,float,float); // main function int main() { float theta, cotheta, sitheta, distance, velocity, time, height; cout << " Input the angle of elevation : " << …

Member Avatar for vmanes
0
103