[try Beta version]
Not logged in

 
can we insert symbols ? ? dev c++

Pages: 12
Dec 23, 2010 at 4:15pm
is there any way to insert symbols in dev c++ ? i want to insert a symbol of "ROOT" so how can i do that ??
Dec 23, 2010 at 6:24pm
What's the symbol of ROOT? do you mean this '%'?
Dec 24, 2010 at 6:15am
Dec 24, 2010 at 8:08am
copy paste this: √
Dec 24, 2010 at 5:15pm
allrite thanks but how did u got it ?
Dec 24, 2010 at 9:04pm
I googled: unicode square root
Dec 24, 2010 at 9:07pm
wtf don't use taht symbol it's unicode. I'm almost sure you code in ascii not unicode. and how does this post get replies and my doesnt.
Dec 24, 2010 at 11:31pm
Well, you can't use it as an operator, but you can put it in strings, like this for example:
1
2
3
4
5
#include "math.h"
#include "stdio.h"
int main(){
        printf("√2=%f\n",sqrt(2));
}
Last edited on Dec 24, 2010 at 11:32pm
Dec 25, 2010 at 12:06pm
ok .. but u still havent answered from where did u got the symbol ...and counteron what do u mean mine post get replies and ur doesnt ??
Dec 26, 2010 at 3:20am
I just copy-pasted it from a website.
Dec 26, 2010 at 9:10am
:P i found another way .. hold right alt and type 251 of the numpad .. try it the symbol come :))
Dec 29, 2010 at 6:50pm
ok i cant use this symbol in c++ . . . it comes up in the form of v
Dec 29, 2010 at 9:23pm
You can use any Unicode symbol in C++.

The problem is displaying anything not in the standard ASCII set gets tricky becaues you have to go outside the standard lib.

How you do it depends on what kind of program you're making and possibly even what OS you're targetting.

Are you making a console program? Are you on Windows?
Dec 30, 2010 at 12:23am
Also, just because you can put the symbol in your text file -- it may not save correctly.

To print the square root symbol to the Windows console using the default code page, use:

1
2
3
4
5
6
7
8
#include <iostream>
using namespace std;

int main()
  {
  cout << "\xFB" << "9 = 3\n";
  return 0;
  }

Hope this helps.
Dec 30, 2010 at 1:33am
Why UTF-8 isn't the default codepage in windows... I'll never know.

Seriously, wtf.
Dec 30, 2010 at 1:44am
im abcd wrote:
ok .. but u still havent answered from where did u got the symbol ...and counteron what do u mean mine post get replies and ur doesnt ??
On windows xp. Start -> All Programs -> Accessories -> System Tools -> Character Map
Dec 30, 2010 at 1:40pm
Disch wrote:
Why UTF-8 isn't the default codepage in windows... I'll never know.
Because it didn't exist when Microsoft designed their multilanguage support... and UTF-8 isn't a code page, it is an encoding system.

That's the dichotomy between software that works, now, on multilingual systems, and a nice, pure system for multilingual support.

MS's code pages were a good answer to the existing technology problems.
Unicode and UTF require existing technology to change to match them.

You'll also notice that MS has made very significant efforts to update their technology to use the at-the-time nascant Unicode -- all their systems now natively use UTF-16. But they also need to continue to support the code page system, in which not just they, but many, many companies around the world, have heavily invested for multilingual systems support.

You can't just throw out older technology at the drop of a consortium's pen. The pecuniary costs are prohibitive.
Dec 30, 2010 at 3:19pm
Duoas wrote:
You can't just throw out older technology at the drop of a consortium's pen. The pecuniary costs are prohibitive.
Good point. Some people just wanna do what is now and forget the past.
Dec 30, 2010 at 3:23pm
closed account (3pj6b7Xj)
Disch, I always wondered that myself, its one of those half-assed jobs M$ does, they make an implementation and leave the rest some where else.
Dec 30, 2010 at 3:29pm
Disch, I always wondered that myself
What have you wondered? If you mean "Why UTF-8 isn't the default codepage in windows... I'll never know." I guess Duoas is right. UTF-8 isn't a code page though I'm not certain what exactly a code page is but I'm sure Duoas is right.

they make an implementation and leave the rest some where else
What do you mean here?
Pages: 12