User Profile

Collapse

Profile Sidebar

Collapse
aniait
aniait
Last Activity: Nov 13 '08, 06:05 AM
Joined: Jul 15 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • aniait
    started a topic divide by zero error ignored !
    in C

    divide by zero error ignored !

    Hi,

    I just came across a faulty code of mine when working on Symbian C++ code. It threw an exception for the code fragment below (or something similar to this):

    Code:
    int x;
    for(int i = 2; i >= 0 ; i--)
    	{
    	x = 5 % i; // [B]Divide by zero exception here when i = 0.[/B]
    	x++;
    	}
    So, I tried the same on Visual C++ and gcc compiler. The funny thing is, I do not get an exception when...
    See more | Go to post

  • aniait
    replied to templated constructor for nested classes
    in C
    Well, I was wondering if I could put the definitions of all functions in a separate .inline file. That way, I could separate the declarations and definitions. Seems a bad idea now.
    See more | Go to post

    Leave a comment:


  • aniait
    replied to templated constructor for nested classes
    in C
    Thanks. I know that making the constructor inline works. I wanted to know how to do that in a different manner.

    Regards,
    Anirudh
    See more | Go to post

    Leave a comment:


  • aniait
    started a topic templated constructor for nested classes
    in C

    templated constructor for nested classes

    I have declared and defined the class LinkedList as:
    Code:
    template <class T> class LinkedList {	 private:	 	class List 	{ 	public: 		List(T& aEle); 	public: 		T& iEle; 		List* iNext; 	}; 	List* iHeader;	 	List* iCurrent; public: 	LinkedList();  // Member functions };
    I am finding it difficult to define the constructor for the List class. I have something like this:
    Code:
    template <class T> LinkedList<T>::List::List(T&
    ...
    See more | Go to post
No activity results to display
Show More
Working...