1 more/less
Post your C# code snippets in here.
4 posts
Page 1 of 1
Instead of
Another tip to improve your code
Increment/Decrement while displaying
Now you know that you can use x++ and x-- , you don't need to do this :
use
Tell me all mistakes you see or how it can be improved!
Code: Select all
just do
int x =0;
x +=1
//or
x = x+1
Code: Select all
++ that means increase a variable with 1x++
Another tip to improve your code
Code: Select all
use
int x = 0;
x = x-1
//or
x -=1
Code: Select all
instead thnx mandai ;)x--
Increment/Decrement while displaying
Now you know that you can use x++ and x-- , you don't need to do this :
Code: Select all
or decrement and show( you should know what that means by now )x++
Messagebox.show(x)
use
Code: Select all
Messagebox.Show(++x)
//or
Messagebox.Show(--x)
Tell me all mistakes you see or how it can be improved!
Last edited by Axel on Mon Apr 04, 2011 8:33 pm, edited 2 times in total.
Meh thought i'd add a quick example of it being used.
Code: Select all
using System;
using System.Text;
namespace Test
{
class Program
{
byte x;
static void Main(string[] Args)
{
for (byte i = 0; i < 10; i++)
{
x--;
Console.WriteLine("The current value of x := {0}", x);
}
}
}
}
Bound and boom tech,
The Future Of Coding
The Future Of Coding
4 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023