User Profile

Collapse

Profile Sidebar

Collapse
Suyash Upadhyay
Suyash Upadhyay
Last Activity: Jun 26 '07, 08:10 AM
Joined: Mar 25 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Suyash Upadhyay
    replied to String Problem
    in C
    Yes, I mean array of 3 strings.

    Answer in C or C++ both are OK with me, because I am confident in both languages....
    See more | Go to post

    Leave a comment:


  • Suyash Upadhyay
    started a topic String Problem
    in C

    String Problem

    Hello all,
    this question was asked in an interview..
    you have a string xCy consists only 'A' and 'B' , where x,C and y all are string but y is in reverse order of x,i.e., if x is 'ABAAB' then y should be 'BAABA'.
    I was to find out whether a particular string is of the form of xCy or not. I could only access next character of string. ( so it was not possible to compare first element to last one, then second to second last and...
    See more | Go to post

  • I don't think so. As per my networking knowledge, computer will know MAC address of it's router not of my friend's situated at foreign....
    See more | Go to post

    Leave a comment:


  • Suyash Upadhyay
    replied to Finding Duplicate Elements
    in C
    I am aware of set<> but I want to search algorithm better than O(n^2) and algorithm proposed is O(n^2). Cann't we make it better?...
    See more | Go to post

    Leave a comment:


  • Suyash Upadhyay
    started a topic Finding Duplicate Elements
    in C

    Finding Duplicate Elements

    How to find more than one duplicate elements in array? ( One method is BST, but I want efficient method than it)
    See more | Go to post

  • Suyash Upadhyay
    started a topic Unpredictable Answer.
    in C

    Unpredictable Answer.

    Hello All,
    I was just trying to understand concept of float and double, when I write this code I got strange output:

    Code:
    #include<iostream>
    using namespace std;
    
    int main()
    {
    	float a;
    	double b;
    	a=0.7;
    	b=0.7;
    	if(a<0.7)
    		cout<<"A"<<endl;
    	else
    		cout<<"B"<<endl;
    	if(b<0.7)
    ...
    See more | Go to post

  • Does MAC address necessary for packet delivery?

    Hello all,
    I am newbie in Networking. I have just started studying Networking.

    I have a doubt

    " Do every router/gateway determines physical address of other router or systems prior to the delivery of packets? If it is so then what is the need of IP address?"

    Please help me to understand core networking concepts.

    Thanx and regards,

    Suyash.Upadhyay
    See more | Go to post

  • Suyash Upadhyay
    started a topic Unicode Support in C
    in C

    Unicode Support in C

    Hello All,

    I am involve in building a software which will manipulate hindi texts. I want to handle hindi text files in C. In unicode specification Hindi characters are supposed to take 4 bytes.
    I tried to handle them using wchar_t but still I am getting error.
    Can anyone please tell me how can I handle hindi characters or what is the correct format of using wchar_t?

    Please Help Me.
    Suyash
    See more | Go to post

  • It is not explicitly mentioned whether we can use pointers or not. I was also thinking to use pointers. Is there any other method possible?

    Suyash...
    See more | Go to post

    Leave a comment:


  • Suyash Upadhyay
    started a topic Reversing string without using indexing..
    in C

    Reversing string without using indexing..

    Hello all,
    I encountered a programming problem while going through interview questions asked by companies. But I stuck at this:

    Given an array of characters. How would you reverse it? How would you reverse it without using indexing in the array?

    Please Help..

    Suyash..
    See more | Go to post

  • Suyash Upadhyay
    replied to Fastest way to mulitply by 7
    in C
    Thanx...
    But I wanted to ask why this method is better because subtraction bears overhead like multiplication.

    Suyash
    See more | Go to post

    Leave a comment:


  • Suyash Upadhyay
    started a topic Fastest way to mulitply by 7
    in C

    Fastest way to mulitply by 7

    Hello all,

    I got the answer that fastest way to multiply by 7 is n<<3 - n, but why?

    If the question is to multiply by 8, then n<<3 is considerably better than n*8, because bitwise operation is faster. But when we multiply by 7, we are also subtracting n, it may be more cumbersome than multiplying directly with 7.

    please answer,
    Suyash
    See more | Go to post

  • Thanx Adrian,

    But can you please tell me

    Why extern int var; is declared and int var; is defined?

    Thanx;

    Suyash
    See more | Go to post

    Leave a comment:


  • Difference between Declaration and Definition of a variable?

    Hello all,

    I am despondent to handle difference between declaration and definition of a variable. I have been totally confused.

    Please help me,

    Thanx in advance

    Suyash
    See more | Go to post

  • Suyash Upadhyay
    replied to C++ Puzzle
    in C
    Thanx for your reply,

    But why it is necessary to use pointers:-

    Following code produces same result upto some extent( till 4th-5th elements):-

    [CODE=cpp]#include<iostre am>
    using namespace std;

    struct exp
    {
    int a[1];
    };


    int main()
    {
    struct exp s;
    for(int i=0;i<4;i++)
    s.a[i]=i;
    cout<<endl;...
    See more | Go to post

    Leave a comment:


  • Suyash Upadhyay
    started a topic C++ Puzzle
    in C

    C++ Puzzle

    Hello all,
    I got one question from my colleagues to answer.

    The question is:

    " How can I declare an array with only one element and still access elements beyond the first element (in a valid fashion)? "

    But, I could not answer, Can anyone please help me to solve this problem?

    Thanx in advance

    Suyash
    See more | Go to post

  • Suyash Upadhyay
    started a topic Object Creation Problem
    in C

    Object Creation Problem

    Hello All,
    I was going through a very simple looking program, but as I am a newbie in C++ it created problem for me. I thought it will give compilation error but it went smoothly.

    Code:
    #include<iostream>
    using namespace std;
    
    class sample
    {
    	int i;
    	public:
    		sample(int ii)
    		{
    			i=ii;
    		}
    };
    
    class comp
    {
      	sample s;
    ...
    See more | Go to post

  • Suyash Upadhyay
    started a topic character constant is tool long of its type
    in C

    character constant is tool long of its type

    Hello all,

    I am getting warning with following line:-

    wchar_t d=L'aa';

    Warning : character constant is tool long of its type

    Please help me to solve this problem..

    Thanx

    Suyash
    See more | Go to post

  • Suyash Upadhyay
    started a topic Handling .doc files
    in C

    Handling .doc files

    Hello All,
    I am working on a project and I need to handle .doc files using C on Linux. But I am not getting any method how can I do so.
    Can anyone give me any idea about it.

    Thanx in advance.
    See more | Go to post

  • Suyash Upadhyay
    started a topic Puzzle
    in C

    Puzzle

    Hello All,

    Why output of this program is 10 and 6. Please the reason.

    main()
    {
    int x=1;
    x=++x + ++x + ++x;
    printf("%d\n",x );
    x=1;
    x=x++ + x++ + x++;
    printf("%d\n",x );
    }

    Output:-
    10
    6

    Thanx in advance
    See more | Go to post
No activity results to display
Show More
Working...