lxXTaCoXxl 26 Posting Whiz in Training

These are just some of the more useful #define statements I've used in C++. These are some of the statements you'll use the most (in the case of template<typename T> when you use it, you use it a lot!). So I figured I'd post it for others, even though a lot of the programmers probably already have this list.

Lucaci Andrew commented: -1
lxXTaCoXxl 26 Posting Whiz in Training

Nevermind, thanks for anyone that read but I fixed the problem and don't want the source code visible to the public so if someone can please remove this post. Sorry for the secretivity, but it's kind of a promotional project.

lxXTaCoXxl 26 Posting Whiz in Training

This guy posted a spam post obviously because it's his only post, and he hasn't been online since he posted; also his account was created the same day the post was made. Granted that's how I started my account because I was leery of whether or not the site would help, but when I came back to check my post it was helpful and I decided to stay around. However I already answered the thread perfectly. We all know there are no destructors in C because it's not object oriented; so I posted a C# destructor example because it was obviously a type-o.

Jamie

lxXTaCoXxl 26 Posting Whiz in Training

hey dude

&&-means logical AND operation
||-means logical OR operation

give problem is
a=true;
b=false;
c=false
then
d=( a && b ) || c
//a && b-means (true && false)
//&&-return true when both input are true here one is true (a) another
//one is false(b) this will return false
//in next step it calculate false || C
// ||-return true when any one of the input true here both are false (a&&b)
// and c so result false will assigned to d
hence result d is false

I believe that was my response just in shorter and more confusing words? O_o

lxXTaCoXxl 26 Posting Whiz in Training

&& is the and operator; the way it works is the value it returns is true when both sides of it are true, and only when both sides are true, any other time it returns false.

|| is the or operator; I forget how it returns until I'm actually using it for some reason, but it's about like saying if (x is > y or x is > 15) doSomething();.

! is the not operator; this basically returns the opposite of the boolean value you assign it to. When used in conditionals if (x != 10) this basically saying that if x is not equal to 10 (any other value than 10) to execute the code in the if block.

So basically if I remember correctly the or operator returns true only when both sides are false. So when a is true, b is false, and c is false; the statement (a && b) || c should return false.

The if () conditional only checks for boolean values, even when using integers or strings it returns a true or false value to the if. When the value is true (condition met) then it executes the code block below it. If it returns false (condition not met) it skips the following block of code and checks for an else if or else block.

That should sum it up quite decently, if you need anything else just let me know. Please just note, I'm not the best …

mani-hellboy commented: You told with exaple and it like "thalaiya suthi mooka thodura mari" tamil proverd its waste I told sort and opt answer -1
Philippe.Lahaie commented: (the or operator returns true only when both sides are false) wrong :S -1
lxXTaCoXxl 26 Posting Whiz in Training

We have no control over when the destructor is called, because the times it is called are determined by the garbage collector. In a general sense the garbage collector reads for items that are not being currently used by the application. When it considers an item is ready to be destroyed, it calls the destructor (if there is one) and takes back the memory that was borrowed to store the item. Destructors are also called when the application exits. Any destructor implicitly calls the Finalize method of the base class.

// So basically this:
class MyClass
{
    ~MyCass()  // destructor
    {
        // cleanup statements
    }
}

// Is eventually just implicitly converted to:
protected override void Finalize()
{
    try
    {
        // Cleanup statements
    }
    finally
    {
        base.Finalize();
    }
}

You should really be more specific with your questions though.

Jamie

mani-hellboy commented: you put C# instead of C ,do you know C don`t have class and object -1
lxXTaCoXxl 26 Posting Whiz in Training

I wouldn't use WriteAllLines all though it sounds as if it would be useful. I would simply create a foreach loop that goes through the lines of text in 'ta' and writes it to the fie.

foreach (string line in ta.Text)
{
//Put writing code here
}

But that's just me; I don't generally deal with System.IO so I can't be too much help, but with a little reading on Google about how to save your files using System.IO you can implement it into a foreach, or find exact information on what you're looking for. I hope this gives you a slight push in the right direction.

Good Luck,
Jamie

***EDIT***
Okay, I revised your post (as I usually do after replying to ensure my reply is accurate) and I thought you were using a text box control. But seeing as you're using TextArray to do this I have no clue because I've never heard of the namespace. Probably have used it without knowing, but never have actually caught the name in full view like that. Sorry I can't be more assistance. I also don't see anything trying to save the file in there, but I may be just glimpsing too quickly.

Jamie

***EDIT***
Look into StreamReader/StreamWriter. It might help out:

Read

// Specify file, instructions, and privelegdes
file = new FileStream("test.txt", FileMode.OpenOrCreate, FileAccess.Read);

// Create a new stream to read from a file
StreamReader sr = new StreamReader(file);

// …
lxXTaCoXxl 26 Posting Whiz in Training

I've developed a simple class and enum that will make ammunition creation and usage simpler in game development for those who are interested. I will be making a tutorial video on how I made this so that you will fully understand how the code works if you do not. Simply implement it into your game by declaring it, and using the methods and variables to your advantage. For example:

private Ammunition myAmmo = new Ammunition(30);

private void button1_Click(object s, EventArgs e)
{
// fire the gun, and output the remaining bullets to the screen for display
myAmmo.Fire(FireMode.ThreeShotBurst, false); // leave as false unless the user is firing their weapon on automatic.

label1.Text = "Ammo Left: " + myAmmo.ClipContents.ToString() + "/" + myAmmo.ClipCapacity.ToString();
}

Happy shootings,
Jamie

lxXTaCoXxl 26 Posting Whiz in Training

Never give up a search for anything friend. I don't know anything about them and haven't heard of them. However I'm sure we can both wait around for some smarter people to get online and tell us all about them. For I am interested in them as well now. :)

lxXTaCoXxl 26 Posting Whiz in Training

I've decided to join the United States Armed Forces, and my MOS will be 25 Bravo. For those in the military or trying to join, or just want to help support those who do, I'm developing an application to help us all out. Eventually I want to develop an information application, but for now I'm just going to develop a main application for tracking PT, diet, dates,...

Battery is dying will put this on the charger to finish post. have to close the lid.

M.Waqas Aslam commented: just waste my 1 mint , is this forum is for fun :-| -1
lxXTaCoXxl 26 Posting Whiz in Training

I'm guessing no one here seems to have the energy or smarts either or, to even attempt to help me fix at least the integer problem?