User Profile

Collapse

Profile Sidebar

Collapse
Gobi Sakthivel
Gobi Sakthivel
Last Activity: Jul 30 '14, 11:31 AM
Joined: Jan 21 '13
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Gobi Sakthivel
    started a topic ld: entry point (start) undefined
    in C

    ld: entry point (start) undefined

    i am new to MAC OSX, actually i installed a gcc compiler (4.2.0) in it and it gets installed in /usr/bin/gcc (default location)
    Using this gcc i can compile and run anything, everything is fine with this.

    Now again i installed new gcc(4.9.0) locally in /root/.../My_gcc and changed the PATH varialble to /root/../My_gcc:$PATH
    and when i give gcc -- version, new gcc 4.9.0 is displayed in terminal, Now using this new gcc...
    See more | Go to post

  • Gobi Sakthivel
    started a topic Static functions are not thread safe in C++
    in C

    Static functions are not thread safe in C++

    Hi,
    In have finished a project in C++, in that i have written a class Utils.cpp as given below
    Code:
    class Utils
    {
    public:
    static int stringToInt(std::string);
    static float stringToFloat(std::string);
    //Many more Generalized functions like this
    }
    After everything is done, while testing the project, i am getting some wired results while accessing this class functions. Later...
    See more | Go to post

  • Gobi Sakthivel
    replied to Windows library Size
    in C
    The compile options i am using,

    %VCLIB% /c /W0 /Ox /EHsc /GR /D "NDEBUG" /D "_WIN32_" /MD /I%PT_INC% /I%CPP_INC% %SRC%\*.cpp
    See more | Go to post

    Leave a comment:


  • Gobi Sakthivel
    started a topic Windows library Size
    in C

    Windows library Size

    I am using
    Code:
    #include <vector>
    #include <map>
    In my c++ project, and these 2 header files are included in almost 200 .cpp files and when i build a static library for the whole project in linux its size is around 10MB and when i did the same thing in windows its size is almost over 80MB, and one thing i noticed was both vector and map combinely takes 500KB in each .cpp file in windows. I am building the...
    See more | Go to post

  • Gobi Sakthivel
    replied to Unicode Characters Size
    in C
    @weeknessforcat s Thanks for your reply, can you give me a link to understand the unicode much better in C++.
    See more | Go to post

    Leave a comment:


  • Gobi Sakthivel
    replied to Unicode Characters Size
    in C
    Actually my string contains only 5 characters which is of square shape (unicode character), the bytes.com viewer shows like 10 characters as '?'. Don't get confused by it.
    See more | Go to post

    Leave a comment:


  • Gobi Sakthivel
    started a topic Unicode Characters Size
    in C

    Unicode Characters Size

    Code:
    std::string str ="����������";
    std::cout<<str.length()<<std::endl;

    this code returns 20, hence each unicode character is considered as 4 bytes, but the same code in java returns 10, where each unicode character is considered as 2 bytes.

    My Question why java and c++ treats different size for the same kind of character, also if it is because of their own implementation, then...
    See more | Go to post

  • use gdb and get the back trace of the point where it is getting crashed actually, from that u can analyze the cause for your crash.

    To use gdb in linux
    =============== ====
    gdb ./Sample.bin, it will start gdb
    press 'r' to run the application inside gdb
    once the application gets crashed, give 'bt' in the terminal
    it will show the entire backtrace of the crash
    See more | Go to post

    Leave a comment:


  • Gobi Sakthivel
    started a topic Template Return Type
    in C

    Template Return Type

    Code:
    class xxx
    {
        public:
        template<class T>
         T void func(int a)
         {
            /* Here depending upon some-cases, i ll return                                       
             * either int, float, std::string, etc...
             * How to do it, i am getting undefined refernce  
             * to func
             */
        }
    };
    See more | Go to post

  • @weaknessforcat s, Thanks for ur reply, As u said i have implemented a similar functionality like what(), and it is working fine.:), But u said something about Visitor, what is that, it is a concept in c++?
    See more | Go to post

    Leave a comment:


  • Banfa, Thanks for ur reply, but in my application i have more than 50 Exception classes, and more than 100 files i am using those exceptions, so i cant catch each exception for every case in all files, i can catch the base exception up-to some hierarchy and can do some operation based on the catched exception. For Eg, There are some cases,


    ExceptionHirear chy
    =============== ===

    HeadExcep...
    See more | Go to post

    Leave a comment:


  • Gobi Sakthivel
    started a topic Catching base class Exception as Reference.
    in C

    Catching base class Exception as Reference.

    Code:
    class BaseExcep
    {
    protected:
          std::string message;
    
    public:
          BaseExcep(std::string);
          virtual void printException();
    
    };
    
    class DerivedExcep1 : public BaseExcep
    {
    public:
          DerivedExcep1(std::string);
    };
    
    class DerivedExcep2 : public DerivedExcep1
    {
    public:
         DerivedExcep2(std::string);
    };
    ...
    See more | Go to post
    Last edited by Gobi Sakthivel; Jul 23 '13, 08:14 AM. Reason: Added proper comments

  • Gobi Sakthivel
    replied to to get time and write it to a file in c
    in C
    Code:
    
    
    #include <stdio.h>
    #include <time.h>
    #include <sys/time.h>
    
    void getTime()
    {
    	FILE* fp = fopen("Time.txt","w+");
        struct timeval usec_time;
        time_t now = time(0);
        gettimeofday(&usec_time,NULL);
        // format time
        struct tm *current = localtime(&now);
        printf("%d:%d:%d\n",current->tm_hour,
    ...
    See more | Go to post

    Leave a comment:


  • Generally while writing C programs people used to do that, the reason for it in some compilers like Turbo C, the output of the previous program is still there on the output stream to clear those they will use clrscr().For y they using it after after variable declaration, in some OS u have to declare the variables at the beginning of the scope, otherwise it will give some warnings, that's they normally use it after declaring all the possible variables,...
    See more | Go to post

    Leave a comment:


  • Release Mode , Maximum optimization O2, No CLR Support, No Unicode , and It is C++ code.

    Flags used while compiling /c /W0 /O2 /GX /GR /DVER_7 /D "NDEBUG" /D "_WIN32_"
    See more | Go to post

    Leave a comment:


  • Gobi Sakthivel
    started a topic Object file size increases in windows! why?
    in C

    Object file size increases in windows! why?

    My sample.h is
    Code:
    #include <string>
    namespace xxx
    {
          class abc
          {
               std::string m_name;
    
               public:
                  void initialize();
          };
    };
    My Sample.cpp is
    Code:
    #include <sample.h>
    using namespace xxx;
    
    void abc::initialize()
    {
        m_name = "Siva";
    ...
    See more | Go to post

  • Gobi Sakthivel
    started a topic Warning in GCC Compiler
    in C

    Warning in GCC Compiler

    I am getting a warning, when i compile the source code in HP_UX platform(GCC Compiler), Can anyone explain why this warning occurs and some solutions to remove it.

    /var/tmp//ccUss4qx.s: Assembler messages:
    /var/tmp//ccUss4qx.s:1245 8: Warning: Use of 'mov' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 33
    /var/tmp//ccUss4qx.s:1245 6: Warning: This is the location of the conflicting...
    See more | Go to post

  • Gobi Sakthivel
    replied to General Protection Error in C++ code
    in C
    Can u explain what is meant by convolution, and give some sample input and output to make it clear.
    See more | Go to post

    Leave a comment:


  • Gobi Sakthivel
    started a topic what is the real meaning of NULL?
    in C

    what is the real meaning of NULL?

    Code:
    int main()
    {
        int* a= NULL;
        return 0;
    }
    Here Integer pointer is assigned to NULL, I dont know
    the complete meaning of NULL till now. I am assuming tat a particular memory location is named as "NULL" and the pointer's which are assigned to NULL, points to tat particular location. Can anyone clear this basic doubt for me.
    See more | Go to post

  • Is it necessary the function main() should return int?

    If so what is the reason, and the returning int value indicates wat?
    See more | Go to post
No activity results to display
Show More
Working...