Search:

Type: Posts; User: agarwaga

Page 1 of 2 1 2

Search: Search took 0.02 seconds.

  1. Thanks a lot everyone . -Gaurav

    Thanks a lot everyone .

    -Gaurav
  2. kerninghan ritchie pg102 last paragraph "Any...

    kerninghan ritchie
    pg102 last paragraph
    "Any pointer can be meainingfully compared for equality or inequality with zero. But the behavior is undefined for arithmetic or comparisons with pointers...
  3. i want to check if pt1 and pt2 point to same...

    i want to check if pt1 and pt2 point to same instance (data in instances is not relevant to me).....

    can i simply do pt1 == pt2
    i have read that you can't compare two pointers unless they point...
  4. how to check if two link list nodes are same .. ?

    I have two pointers pt1 and pt2 pointing to link list nodes.
    I read that two pointers can not be compared (they can be only in case they point to member of same array) , then how do i check that...
  5. Replies
    1
    Views
    2,452

    permutations of a string

    how do you print all the permutations of a string when:
    1)assume all characters are distinct .
    2)can have duplicate characters

    i know how to do it recursively:
    example string is abc...
  6. Thread: multiply by 7

    by agarwaga
    Replies
    1
    Views
    1,652

    multiply by 7

    how will you multiply a positive number by 7 without using straight forward multiplication and addition.

    best i could find out was


    int func(int n){
    int temp = n<<3; //multiply by 8
    return...
  7. Replies
    2
    Views
    870

    referring to a[-1],a[len]

    take this function


    /* this checks if t is at the end of s*/
    int mystrend(char* s,char* t){
    int l1 = strlen(s);
    int l2 = strlen(t);
    if(l2 > l1) return 0;
    s = s + l1 - 1;
    ...
  8. Replies
    3
    Views
    1,635

    thanks a lot dave -gaurav

    thanks a lot dave

    -gaurav
  9. Replies
    3
    Views
    1,635

    bit operations

    I want to rotate right a number by n bits. I don't have the width of the word of the machine and i wan't to solve my problem without finding out the width.(one can always find out the width of a word...
  10. Replies
    2
    Views
    1,831

    c library function conceptual doubt

    When i write a c program using a c library function say malloc , is the machine code for the malloc (which includes system calls or similar calls) present in the executable ?
    or does every OS has...
  11. Replies
    5
    Views
    1,741

    thanks a lot :D

    thanks a lot :D
  12. Replies
    5
    Views
    1,741

    #include void display(int* arr,int...

    #include <stdio.h>
    void display(int* arr,int len){
    int i;
    for(i = 0; i < len; ++i){
    printf("%d ",arr[i]);
    printf("\n");
    }
    }
    main()
    {
  13. Replies
    5
    Views
    1,741

    for an array a , is a same as &a

    #include <stdio.h>
    void display(int* arr,int len){
    int i;
    for(i = 0; i < len; ++i){
    printf("%d ",arr[i]);
    printf("\n");
    }
    }
    main()
    {
  14. Replies
    2
    Views
    1,096

    c program , kinda wierd

    main()
    {
    int a[] = { 2,4,6,8,10 };
    int I = 0;
    printf("%d ",I[a]);
    printf("%d ",0[a]);
    printf("%d ",1[a]);
    printf("%d ",2[a]);
    printf("%d ",3[a]);
    }
  15. Replies
    14
    Views
    2,041

    it does compile (Borland C++ 5.5.1 for Win32) ,...

    it does compile (Borland C++ 5.5.1 for Win32) , leave the class mentioned above
    even the code mentioned below compiles , although it doesn't produce the result i expected
    ...
  16. Replies
    14
    Views
    2,041

    My problem is with the array's length not being...

    My problem is with the array's length not being specified. Can it make sense in some case ?
    Btw, how do you give the size of this array afterwards?
  17. Replies
    14
    Views
    2,041

    does this make sense ??

    does this given class make sense, if yes where can it be useful ??


    class A{
    public:
    int a[];
    };
  18. Replies
    5
    Views
    1,323

    also change template void...

    also change


    template<class T>
    void TestTT>::SetBalance()
    { balance = 100;
    }

    to
  19. Replies
    5
    Views
    1,323

    the change mentioned below should solve ur...

    the change mentioned below should solve ur problem


    catch(Test<float>::whoops) // <--- This is giving me a parse error
  20. Replies
    19
    Views
    2,070

    i am returning back to C++ after quite some time...

    i am returning back to C++ after quite some time ...
  21. Replies
    6
    Views
    22,650

    I will suggest you use a vector of strings if the...

    I will suggest you use a vector of strings if the file is not too big


    // reading a text file
    #include <iostream>
    #include <fstream>
    #include <string>
    #include <vector>
    using namespace std;
  22. Replies
    19
    Views
    2,070

    i don't know abt the later half of ur code , but...

    i don't know abt the later half of ur code , but u can improve the first half quite a lot ..


    #include <iostream.h>
    #include <stdio.h>
    using namespace std;
    int main(){
    char Command[128];...
  23. Replies
    3
    Views
    923

    i am using Borland C++ 5.5.1 for Win32

    i am using Borland C++ 5.5.1 for Win32
  24. Replies
    3
    Views
    923

    problem with exception behavior

    /*
    the code below prints copy constructor called three times , i can trace 2 times , one at throw in myfunction and one at catch(A e) in main .... can somebody explain the third

    */


    ...
  25. Replies
    1
    Views
    2,687

    physical address or logical ??

    #include <iostream.h>
    void main(){
    int a = 1;
    cout<< &a;
    }


    is the address output the actual physical memory address of the variable or some logical address.
Results 1 to 25 of 33
Page 1 of 2 1 2