delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/15/19:46:15

From: bigphil AT merlin DOT magic DOT mb DOT ca (Mark Phillips)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: ' ^ '
Date: Wed, 15 Oct 1997 19:53:06 GMT
Organization: MBnet - Manitoba's Connection To The Internet
Lines: 27
Message-ID: <62365c$r32$1@postern.mbnet.mb.ca>
References: <621df9$cp9 AT camel12 DOT mindspring DOT com>
NNTP-Posting-Host: 204.112.6.186
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I'm just a casual programmer as well, so forgive me if everything 
I say is untrue.
I don't think ^ exists as an operator in C or C++ at all, that's just
in some other languages.  If I remember correctly, in the header 
"math.h" there is a function pow which raises a number to the power
like this:
y = pow(3,6);  // y is assigned 3 to the power of 6
y = pow(6,3); // y is assigned 6 to the power of 3
etc.

mark

>Hi. I'm just a casual programmer, so excuse me if this is a foolish
>question. I cannot get the ^ operator to work in my programs using DJGPP. It
>returns error messages basically saying it doesn't know what it is. I'll try
>something like this:

>    cout << 3^2;

>and it happens. Do I have to include some weird header file, or am I just
>screwed? Any help appreciated.

>Mike




- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019