User Profile

Collapse

Profile Sidebar

Collapse
vpawizard
vpawizard
Last Activity: Jul 19 '07, 07:06 AM
Joined: Nov 11 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hello,
    Another less obvious but often overlooked difference is,
    strcpy() - The strings may not overlap, and the destination string dest must be large enough to receive the copy.
    memcpy()- If copying takes place between objects that overlap, the behaviour is undefined.


    (P.S. - This problem ate up my whole day to figure it out)
    See more | Go to post

    Leave a comment:


  • Use the system calls or API.
    See more | Go to post

    Leave a comment:


  • vpawizard
    replied to Run an .exe file from an c++ application
    in C
    Hello,
    U can also use exec*() functions.
    http://linux.about.com/library/cmd/blcmdl3_execl.h tm

    Regards,
    See more | Go to post

    Leave a comment:


  • vpawizard
    replied to Make Library
    in C
    Hello,
    What type of library do you want to create - static or shared? The following link is a good reference:
    http://users.actcom.co .il/~choo/lupg/tutorials/libraries/unix-c-libraries.html
    http://www.adp-gmbh.ch/cpp/gcc/create_lib.html

    Regards,
    See more | Go to post

    Leave a comment:


  • vpawizard
    replied to What compiler do you use?
    in C
    Hello,
    I prefer SUN's cc or GNU's gcc or g++. For IDE, I generally code on Unix platform so use any editor(vi or ed).

    Regards,
    See more | Go to post
    Last edited by vpawizard; Jun 23 '07, 04:54 AM. Reason: Correction

    Leave a comment:


  • For best execution speed, should I cache in Main memory or keep querying the Database

    Hello,
    In my application, I need to read data of two sizes - about 10 bytes and 5-50KB. I need optimum performance of my application - speed is my main concern. Would it be wise to read 10 bytes from database and 5-50KB data from main memory(this data is read from database and cached in memory)?
    Please suggest. Thanx in advance.
    See more | Go to post

  • vpawizard
    replied to regarding socket programming in c
    in C
    Hello,
    TSDN members can help you much better if you post your xact problem, what did you attempt n where r u stuck?
    If you are programming in UNIX, the header files are sys/socket.h contains socket functions and system calls. netinet/in.h contains protocol-related functions. Hope this gives you atleast a starting point.

    Regards,...
    See more | Go to post

    Leave a comment:


  • vpawizard
    replied to remove loop from a linked list
    in C
    Hello,
    A simple technique is to create a flag member in the node to indicate whether node has been visited or not. If the node is visited, the flag is set. If the node is revisited, the flag will be set indicating loop. However, if you want to find the loop, the algorithm will be too expensive.


    Regards,
    See more | Go to post

    Leave a comment:


  • vpawizard
    replied to different loops.
    in C
    Well it doesn't really matter who posts first. We all work for C/C++, right pal !!!...
    See more | Go to post

    Leave a comment:


  • vpawizard
    replied to Using C++ To Display Image
    in C
    Hello,

    Every image file has a header and data section. The header section contains the information about the entire image. The data section is the actual image. You can do some googling and find out the header format for images and read the header and data sections of the image file and display it on the output device.


    Regards,
    See more | Go to post

    Leave a comment:


  • vpawizard
    replied to Calling an object
    in C
    Hello,
    One possible way is to override displaySin() in the derived class:

    Code:
    class Person
    {
        public:
        void displaySin();
    };
    
    class Student: public Person
    {
        public:
        void displaySin()
        {
            Person::displaySin();
        }
    };
    Regards,
    See more | Go to post

    Leave a comment:


  • vpawizard
    replied to different loops.
    in C
    Hello,
    Welcome to C.

    1) for - Used when the number of times the loop will iterate is known in advance. e.g. for(i=0;i<10;i+ +) will iterate 10 times.
    2) do - Used when the number of times the loop should iterate is not known. The loop iterates till the condition becomes false. e.g. while(mychar != '\n')scanf("%s" ,&mychar); will iterate till newline is entered.
    3) do....while - This loop iterates...
    See more | Go to post

    Leave a comment:


  • If the project type is not an Application (it could be DLL or anything else), the compiler will build but will not execute. Check the project type you have selected.
    See more | Go to post

    Leave a comment:


  • Hello,
    Only one #include should appear per line. However, this is a very trivial error.
    The path for your include directory is not set. You can set it in the IDE or specify the path while compilation and linking at command line.


    Regards,
    HCV...
    See more | Go to post

    Leave a comment:


  • vpawizard
    replied to c++ adding 2 polynomials
    in C
    Hello,
    Following is the psuedo-code:

    int coef1[10];
    int coef2[10];

    The index denotes coefficient of power n. e.g.3x2+2x1+1 will stored in array as:
    coef1[2]=3;coef1[1]=2;coef1[0]=1;
    Similarly for second polynomial.
    Then, corresponding element in each array is added to get the addition of two polynomials.



    Regards,
    See more | Go to post

    Leave a comment:


  • vpawizard
    replied to malloc and realloc
    in C
    calloc() allocates memory for an array of nmemb elements of size bytes each and returns a pointer to the allocated memory. The memory is set to zero.

    malloc() allocates size bytes and returns a pointer to the allocated memory. The memory is not cleared.

    realloc() changes the size of the memory block pointed to by ptr to size bytes. The contents will be unchanged to the minimum of the old and new sizes; newly allocated...
    See more | Go to post

    Leave a comment:


  • vpawizard
    replied to What is exact meaning of WebService
    in C
    http://en.wikipedia.org/wiki/Web_service...
    See more | Go to post

    Leave a comment:


  • cin>>temp1;
    See more | Go to post

    Leave a comment:


  • Hello,
    Assuming that ur display is 'c' wide. Read the input till 'c' characters are read. Count the number of words 'w'. If the cth character is in the middle of the word, pushback the characters till delimiter(space ) is encountered. After each word, print w divide by c number of spaces.
    See more | Go to post

    Leave a comment:


  • vpawizard
    replied to How to print "0" in the left
    in C
    Hello,
    printf("%.nd",a rg);
    where n is the total digits in the number. e.g. printf("%.5d",1 00) will print 00100.

    Regards,
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...