Displaying "σ" sign in C++

Hi

I am new to C++ programming language. I have done some mathematical computation in my program and right now I am interested in displaying "σ" notation in my output such that the output should display "σ<a,b>".

I know the uni code for "σ" that is "\u03C3" but I don't know how to display it on screen.

Can anyone tell me how to display this sign or other mathematical signs in C++.

Any kind of help is highly appreciated.

Regards
Kanwar
You should use stream std::wcout.
Last edited on
I did a quick google for unicode characters in C++ and found a link from this site:
http://www.cplusplus.com/forum/unices/13257/
I hope it helps.
Last edited on
Hi vlad and kevin

I tried both the methods but its not working.I got the decimal value of sigma which is 963 and tried to use it by the way discussed in the link provided by you kevin but it displays s only and not the "σ" sign.


Regards
Kanwar
Hi guys

I have solved the problem.The below program displays the sigma sign on output screen.

#include "stdafx.h"
#include <iostream>

using namespace std;

int main ()
{
setlocale(LC_ALL,"Greek"); //This accepts the greek value
wchar_t orig = 963; // This is the decimal value of sigma....In order to display any other sign write its decimal value

cout<<"\n\n";
std::wcout<<orig<<endl; //Prints sigma sign

system("pause");
return 0;
}

Thanks for your help guys.

Regards
Kanwar
Last edited on
closed account (4jzvC542)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "stdafx.h"
#include <iostream>

using namespace std;

int main ()
{
          setlocale(LC_ALL,"Greek"); //This accepts the greek value
          wchar_t orig = 963; // This is the decimal value of sigma.

          cout<<"\n\n";
         std::wcout<<orig<<endl; //Prints sigma sign

         system("pause");
         return 0;
}
Topic archived. No new replies allowed.