Need help and explanation on Unary operators


 
Thread Tools Search this Thread
Top Forums Programming Need help and explanation on Unary operators
# 1  
Old 04-09-2011
Need help and explanation on Unary operators

Hello guys. It's orszhak and since I'am starting in programming in c++ I again have stumbled upon something. While I was reading my book it talked about unary operators. I understood that they consist of +, -,++,--. I just want to know what do they do and how do they work. Plus it also talked of prefix, postfix and incrementing and decrementing. It also talked about arguments. So I just want to know what all of that means and of course how it works. The book really didnt me a good explanation for this part. Its only really this part I hope. Anyways, thanks!
# 2  
Old 04-10-2011
Try this tutorial: Operators - C++ Documentation
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk and Unary Operators in Bash

I am getting the following error /home/hagbard/chaos/resip/ictja/siculet-0.0.0/amvib/tmspan.sh: line 135: BEGIN {printf "%.0f", int((tm-(thh*60.0*60.0))/60.0)}: No such file or directory /home/hagbard/chaos/resip/ictja/siculet-0.0.0/amvib/tmspan.sh: line 138: The code is this ... (3 Replies)
Discussion started by: kristinu
3 Replies

2. Shell Programming and Scripting

Unary operator expected

In all my Googling, this usually happens when someone is comparing a variable, and that variable is unset. That doesn't appear to be the case for me... #!/bin/bash -x while read line do f=$(echo $line | tr -s ' ' | cut -d' ' -f 3) echo $f if then echo "This... (2 Replies)
Discussion started by: jnojr
2 Replies

3. UNIX for Dummies Questions & Answers

[: -gt: unary operator expected

Hi I have problem with my script. I dont now why but i don't change anything and script stop working. this is my code: #!/bin/sh for i in `ps -A | grep pocron.sh | grep -v grep | awk '{print $2}'` do COUNT=$((COUNT+1)) done ostatnie_wykonanie=`cat porader.log`... (1 Reply)
Discussion started by: fotex
1 Replies

4. UNIX for Dummies Questions & Answers

: unary operator expected

Hiya all, Why do I get a :unary operator expected when I try to put a condition statement in my shell script (sh) like so and how to fix? if ; then echo "say hello" else echo "don't say hello" fi ? It seems if the script receives an argument it works but if I don't put an... (4 Replies)
Discussion started by: cyberfrog
4 Replies

5. Shell Programming and Scripting

unary operator expected

i=0 while Shell script reports an error "unary operator expected" pointing the above line. $i by default is 0 and holds integer value and $buf is also holding integer value. Please can some one let me know what is missing. Thanks. (1 Reply)
Discussion started by: sunrexstar
1 Replies

6. Shell Programming and Scripting

unary operator is missing

hi , i m getting an error unary operator is missing. pls check why is this so? i=5 while test $i !=0 do echo $i i=`expr $i - 1` done (3 Replies)
Discussion started by: angel12345
3 Replies

7. Shell Programming and Scripting

unary operator expected

Im trying to fix my /etc/weekly that rotates various logs however it does them no matter what filesize they are and i want them to only do it if there file size exceeds 2M or something. So I'm playing with a script to get the filesize using a ls -l command which works and puts the value into a... (3 Replies)
Discussion started by: timgolding
3 Replies

8. UNIX for Dummies Questions & Answers

[: =: unary operator expected

HI, while running a script, I got the below mentioned error. /bin/sh: line10 : supportedMozillaVersion() { case "$*" in *rv:1.*) return 0;; *rv:.*) return 0;; *rv:*) return 1;; Mozilla\ 1.*) return 0;; Mozilla\ .*) return 0;; *) return 1;; esac } supportedFirefoxVersion() { case... (7 Replies)
Discussion started by: bhag281
7 Replies

9. Shell Programming and Scripting

unary operator expected

hi i am trying to compare a value with value 50. but i am getting " I am using if then echo "------------" fi please help thanks in advance Satya (2 Replies)
Discussion started by: Satyak
2 Replies
Login or Register to Ask a Question