Forum

> > Off Topic > SOS!!! Linked list with pointers doesn't work C#
Forums overviewOff Topic overviewLog in to reply

English SOS!!! Linked list with pointers doesn't work C#

7 replies
To the start Previous 1 Next To the start

old SOS!!! Linked list with pointers doesn't work C#

AssassinLV
User Off Offline

Quote
I need to get work this linked list, the Visual Studio 2010 (C#) finds the problem inside bolded text:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
unsafe public partial class spa : Form
    {
        Audio* begAudio;
        Letters* begLetters;
        string path = @"tmp.txt";
        public spa()
        {
            InitializeComponent();
        }
        private void PrepareTextToSpeach_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < Txt.Text.Length; i++)
            {
                char c = Txt.Text[i];
                if (begLetters == null)
                {
                    Letters begLetters = new Letters;

                }
                else
                {
                }
            }
        }
    }

It doesn't allow "Letters begLetters = new Letters"
edited 5×, last 18.06.13 08:21:43 pm

old Re: SOS!!! Linked list with pointers doesn't work C#

TimeQuesT
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
unsafe public partial class spa : Form
    {
        Audio* begAudio;
        Letters* begLetters;
        string path = @"tmp.txt";
        public spa()
        {
            InitializeComponent();
        }
        private void PrepareTextToSpeach_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < Txt.Text.Length; i++)
            {
                char c = Txt.Text[i];
                if (begLetters == null)
                {
                    begLetters = new Letters();
				//you already declared begLetters somewhere
                }
                else
                {
                }
            }
        }
    }
edited 1×, last 18.06.13 08:21:48 pm

old Re: SOS!!! Linked list with pointers doesn't work C#

AssassinLV
User Off Offline

Quote
Done... THANKYOU MICROSOFT COMUNITY!!!

needed to change pointers and structures...:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NAudio;
using NAudio.WindowsMediaFormat;

public class Letters
{
    public char Data { get; set; }
    public Letters Next { get; set; }
};

public class Audio
{
    public int Data { get; set; }
    public Audio Next { get; set; }
};

namespace JRBtranslator
{
    unsafe public partial class spa : Form
    {
        Audio begAudio;
        Letters begLetters;
        public spa()
        {
            InitializeComponent();
        }

        private void PrepareTextToSpeach_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < Txt.Text.Length; i++)
            {
                char c = Txt.Text[i];
                if (begLetters == null)
                {
                    begLetters = new Letters();
                    begLetters.Next = null;
                    begLetters.Data = c;
                }
                else
                {
                }
            }
        }
    }
}

SOLVED...
edited 1×, last 18.06.13 09:13:08 pm
To the start Previous 1 Next To the start
Log in to replyOff Topic overviewForums overview