User Profile

Collapse

Profile Sidebar

Collapse
AhmedGY
AhmedGY
Last Activity: Mar 14 '08, 01:22 PM
Joined: Jan 25 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • AhmedGY
    replied to Simple Insertion sort method
    in .NET
    Any help?

    I tried to use int instead of string, however i don't know how to put string elements inside an array of integers.

    Did it this way:

    Code:
    int[] str = new int[100]; 
    
                for (int k = 0; k < textBox1.Text.Length; k++)
                {
                    string z=textBox1.Text;
    
                    str[k] = textBox1.Text.IndexOf(z,k);  //this should put str[0]=textbox1.text[0]
    ...
    See more | Go to post

    Leave a comment:


  • AhmedGY
    started a topic Simple Insertion sort method
    in .NET

    Simple Insertion sort method

    Hi, am trying to build an app that uses the insertion sort method to sort numbers entered in a textbox and display them sorted in a label, so i wrote this inside the sort button click event:

    Code:
    label1.Text = Insertion.insert(textBox1.Text);
    and here is the insertion class:

    Code:
    class Insertion
        {
            public static string insert(string x)
            {
    ...
    See more | Go to post

  • ok cool it works, i put it that way:

    Code:
    private void Form1_KeyPress(object sender, KeyPressEventArgs e)
            {
                if (label1.Text.Length <= 15)
                {
                    switch (e.KeyChar)
                    {
                        case '1':
                            label1.Text += e.KeyChar.ToString();
                            break;
                        //... etc
    ...
    See more | Go to post

    Leave a comment:


  • I tried to understand the syntax but i couldn't, i don't know what to write inside the keypress event method....
    See more | Go to post

    Leave a comment:


  • Sorry but i don't understand, i just wanna know how to make the keyboard do the math just like pressing buttons with mouse clicks, see just like windows accessories calculator, you don't have to click on every button, u can simply use the keyboard....
    See more | Go to post

    Leave a comment:


  • C# WinApp, How to display number pressed on a textbox?

    Hi, I'm new to C#, and doing a simple calculator application, it's completed now and calculates well, i wanna provide the interface with hotkeys so when the user press a number lets say "1" on the keyboard gets displayed on the textbox, and activate operators when he press em, just like windows xp calculator.

    am using textBox1.Text += ((Button)sender ).Text; to display numbers when clicked by the mouse btw.

    ...
    See more | Go to post

  • AhmedGY
    replied to Difference between i++ and ++i in for loop
    in C
    Thanks, I got it =)

    AhmedGY
    See more | Go to post

    Leave a comment:


  • AhmedGY
    replied to Difference between i++ and ++i in for loop
    in C
    return the old value to where?, as far as i know the update statement return the value to the continuation check, so using i++ will return the old value (which is 0), then increment, lets trace the i in this example:


    Code:
    for (int i = 0; i < 10; i++) 
          {
              printf("%d\n",i);
          }
    i=0 and <10, go inside the loop and print 0, the update statement i++ makes a copy of...
    See more | Go to post

    Leave a comment:


  • AhmedGY
    started a topic Difference between i++ and ++i in for loop
    in C

    Difference between i++ and ++i in for loop

    I know the difference between the prefix/postfix increment, the prefix returns the value after increment, while postfix return it before increment, however i can't see any difference when using FOR loops.

    see:

    for(int i=0;i<10;i++)
    printf("%d",i);
    //prints i=0 and update i++, but since its postfix increment, it's supposed to return the value of i which = 0 and then...
    See more | Go to post
No activity results to display
Show More
Working...