Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #3K
~8K People Reached
About Me

Student (pursuing B.Tech in computer science)

Interests
Playing computer games, playing football
PC Specs
OS: Windows XP with Service Pack2 Intel Centrino mobile technology 1.73Ghz 120GB of Hard disk with 1.49GB…
Favorite Tags
c++ x 24
java x 4
asp x 2

26 Posted Topics

Member Avatar for amitahlawat20

Can someone tell me from where can I download a Personal Web Server for Windows XP SP2, if not , then an alternative for that ?? I want to do programming in ASP on my personal computer.:confused:

Member Avatar for techtix
0
77
Member Avatar for amitahlawat20

Can someone tell me from where can I download a Personal Web Server for Windows XP SP2, if not , then an alternative for that ??:confused: I want to do programming in ASP on my personal computer.

Member Avatar for madmital
0
129
Member Avatar for amitahlawat20

I have got an assignment question : Constructors cannot be virtual , however destructors can. Justify the statement in reference to memory leak. Please help me out figuring the answer.

Member Avatar for Ancient Dragon
0
79
Member Avatar for amitahlawat20

I am not able to figure out how to calculate the determinant of a matrix whose size and elements are to be taken from user. Could someone help me !!

0
73
Member Avatar for amitahlawat20

My instructor at my engineering institute has given the following assignment question: Create a database of scientists and labourers and maintain the same by making use of inheritance. We haven't been taught the database connectivity with program execution, so that's not to be used. I wrote the following code: [code] …

Member Avatar for Ancient Dragon
0
139
Member Avatar for amitahlawat20

I am facing a problem in void pointers in c++. Have a look at the following code: [code=cplusplus] #include<iostream.h> int main() { void *ptr; int x=3; float y=2.35f; char c='A'; ptr=&x; cout<<endl<<*ptr; //line 1 ptr=&y; cout<<endl<<*ptr;// line 2 ptr=&c; cout<<endl<<*ptr;//line 3 cout<<endl; return 0; } [/code] I am getting the …

Member Avatar for sahil_itprof
0
151
Member Avatar for amitahlawat20

Could someone please why do we say that the syntax of enhanced for loop (for-each) in java in streamlined. Also, my java compiler does not compile programs containing the enhanced for loop. It gives errors like: for(int x:collection) { } ^ ; expected Could someone suggest solutions to this?

Member Avatar for jwenting
0
91
Member Avatar for amitahlawat20

I am not able to understand why in the following program it is mentioned in my book: The value of ~a is ANDed with 0x0f (0000 1111) in binary in order to reduce its value to less than 16, so it can be printed by use of the binary array. …

Member Avatar for Phaelax
0
65
Member Avatar for amitahlawat20

Could someone please tell me how to overload ++ operator in the postfix form. ++ sholud increment the instance variable avar of following class: class A { int avar; public: A() { avar=0; } A(int a) { avar=a; } void display() { cout<<endl<<avar; }

Member Avatar for Lerner
0
63
Member Avatar for Moporho

I copied your code and executed it: count =0 in the output. You have used return 0 in your prime() method, so the if in main never receives value 1 and count is never incremented.

Member Avatar for Moporho
0
5K
Member Avatar for arlene1

Your question syas that the function must have a integer parameter representing the number of days past from 1/1/1990. where's that in your code so far??? Your function is still accepting three parameters for the date 1/1/1990. I think it should like this: void yrCalc(int &day,int &month,int &year,int days_past) where …

Member Avatar for amitahlawat20
0
179
Member Avatar for wannabeIT

In your program# 1,after computing sum and product and displaying them to th user , what's the use of cin >> sum >> product; This is again demanding that you enter two more values for sum and product. Also , in your program # 2 , cin.getline is used to …

Member Avatar for Lerner
0
122
Member Avatar for rohoni

C++ tries to make user-defined data type much the same way as the built in data type. We use different kind of operators with the bulit in data type . What about using those operators with the user defined data types, eg classes. Thats where operator overloading comes in.It is …

Member Avatar for amitahlawat20
0
106
Member Avatar for amitahlawat20

could any one tell me the exact syntax and semantics of cin.get() and cin.ignore() ?

Member Avatar for henpecked1
0
83
Member Avatar for amitahlawat20

#include<iostream.h> class A { int avar; public: A() { avar=0; } A(int a) { avar=a; } void dis() { cout<<endl<<"avar = "<<avar; } void operator ++ (); }; void A::operator ++ () /*[B][U] from compilation message it is known that this is prefix form , how do I specify the …

Member Avatar for sarehu
0
77
Member Avatar for amitahlawat20

#include<iostream.h> #include<string.h> class person { protected: char name[20]; int code; public: person(char *a,int c) { strcpy(name,a); code=c; } void dis() { cout<<endl<<"name : "<<name; cout<<endl<<"code : "<<code; } }; class account:virtual public person { protected: long pay; public: account(char *a,int b,long c):person(a,b) { pay=c; } void dis() { person::dis(); cout<<endl<<"pay …

Member Avatar for bugmenot
0
490
Member Avatar for amitahlawat20

I am not able to figure out the code required for accepting a string from user , but the memory for it should be dynamically allocated and referenced using pointer. Have a look at the following: char *p=new char[length_of_string+1]; This statement would work to dynamically allocate the string ,but still …

Member Avatar for Narue
0
94
Member Avatar for amitahlawat20

// runtime error encountered , cannot resolve symbol i ,please help!!! class promote { public static void main(String args[]) { byte b=42; char c='a'; short s=1024; int i=50000; float f=5.67f; double d=.1234; double result=(f*b)+(i/c)-(d*s); System.out.println( (f*b) + " + " + (i/c) + " - " + (d*s) ); System.out.println("result …

Member Avatar for masijade
0
104
Member Avatar for nani_amb

scanf always uses the syntax: scanf("<format_specifier>",&<name_of_variable>); You used the & operator.

Member Avatar for amitahlawat20
0
115
Member Avatar for aminit

Here's one possible way to get desired string2: [code=cplusplus] #include<iostream.h> #include<string.h> int main() { int len1; char *p,*q; cout<<"enter string 1 length : "; cin>>len1; p=new char[len1+1]; cout<<endl<<"enter string 1:"; cin>>p; //--------------------------------- q=new char[len1+1]; cout<<endl<<"enter string 2:"; cin>>q; cout<<endl<<strlen(q); //--------------------------------- int l=strlen(q); for(int i=0;i<l;i++); for(;*(p+i)!='\0';i++) { *(q+i)=*(q+(i-4)); } *(q+i)='\0'; cout<<endl<<"result …

Member Avatar for amitahlawat20
0
120
Member Avatar for amitahlawat20

[code=cplusplus] #include<iostream.h> #include<string.h> int main() { int x; cout<<endl<<"enter x:"; cin>>x; int temp=x; int count=0; while(temp!=0) { count++; temp=temp/10; } char *p=new char[count+1]; for(int i=0;i<count;i++) { *(p+i)='\0'; } for(i=count-1;i>=0&&x!=0;i--) { *(p+i)=x%10; x=x/10; } *(p+count)='\0'; cout<<endl<<"converted string : "; for(i=0;i<count;i++) cout<<(int)*(p+i); // int type cast used , if not used then …

Member Avatar for Narue
0
127
Member Avatar for amitahlawat20

[code=cplusplus] #include<iostream.h> class mat { int **matrix; int row,col; public: mat(int r,int c); void get_element(int a,int b,int value); int &disp_element(int a,int b); int getrow() {return row;} int getcol() {return col;} friend mat operator + (mat &m1,mat &m2); friend mat operator - (mat &m1,mat &m2); ~mat() { delete matrix; } }; …

Member Avatar for Narue
0
80
Member Avatar for amitahlawat20

class matrix { int **p; int d1,d2; public: matrix(int x,int y); //constructor allocates block of specified size /*I am not specifying contructor code*/ void get_element(int i,int j,int value) { p[i][j]=value; } int put_element(int i,int j) { return p[i][j]; } // [U][B]return statement encountering access violation during runtime , Help!!![/B][/U] };

Member Avatar for mitrmkar
0
99
Member Avatar for nickthedivil

One possible solution to your if block is: if( !(strcmp(chartryname,charname)) && !(strcmp(chartrypassword,charpassword) ) cout<<"All entries are correct"; /* Result at execution if entries are correct : if( !(0) && !(0) ) => if ( 1 && 1) => true */

Member Avatar for amitahlawat20
0
113
Member Avatar for amitahlawat20

/* unable to return value from following function due to if - else block within function..*/ mat operator + (mat &m1,mat &m2) //mat is a class for matrix object { int r1=m1.getrow(); //getrow returns number of rows in matrix int r2=m2.getrow(); int c1=m1.getcol(); //getcol returns number of columns in matrix …

Member Avatar for Joatmon
0
104
Member Avatar for amitahlawat20

[code=c++] /* unable to return value from following function - adds two matrix class objects */ mat operator + (mat &m1,mat &m2) // mat is a class for matrices { int r1=m1.getrow(); // getrow returns number of rows int r2=m2.getrow(); int c1=m1.getcol(); //getcol returns number of cols int c2=m2.getcol(); if((r1!=r2)||(c1!=c2)) …

Member Avatar for Ancient Dragon
0
85

The End.