CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2008
    Posts
    2

    Question How to find the cpu architecture using C++ in Linux?

    i am trying to find the architecture of a processor,i.e x64/x86, using c++. OS is Linux.

    i would appreciate any help from u guys..

    thanks.

  2. #2
    Join Date
    Feb 2005
    Location
    "The Capital"
    Posts
    5,306

    Re: How to find the cpu architecture using C++ in Linux?

    Is this related to C++? By the way, try the command uname. Check the man pages for the various options. Also, for further CPU info look into /proc/cpuinfo.

  3. #3
    Join Date
    Mar 2008
    Posts
    2

    Re: How to find the cpu architecture using C++ in Linux?

    i need to do that thru' some code and moreover i tried that /proc/cpuinfo but it has no information about cpu architecture..

    and if you know how to execute a command and get the result using c++ that'll also be very helpful..

    thanks for the reply..

  4. #4
    Join Date
    Feb 2005
    Location
    "The Capital"
    Posts
    5,306

    Re: How to find the cpu architecture using C++ in Linux?

    What does uname -all give? I cannot look at the man right now. But see if there is an API that helps with that or you could simply make a system call.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured