473,508 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Identifier Expected

2 New Member
Hey all I am getting the compiler Identifier Expected on the following code.

public partial class Form1 : Form
{
private const int MaxFiles = 10;
private SourceFile m_sourceFiles(MaxFiles);
private int m_files = 0;

public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
listOfFiles.DataSource = m_sourceFiles;

}

private void cmdBrowse_Click(object sender, EventArgs e)
{
try
{
openSourceFile.Filter = "ASP, ASP.NET, JavaScript files (*.asp, *.aspx, *.js)|*.asp, *.aspx,*.js)";
DialogResult result = new DialogResult();
if (result == DialogResult.OK)
{
SourceFile aFile = new SourceFile(openSourceFile.FileName);
m_sourceFiles(m_files) = aFile;
m_files += 1;
if (m_files == m_sourceFiles.Length)
{
m_files = m_sourceFiles.Length - 1;
}
}
listOfFiles.Refresh();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}


}
}

If any one could help it would be greatly appreciated.
Feb 8 '07 #1
2 8760
jdziggy
2 New Member
Sorry,

The line of code that I am getting this error on is below:

private SourceFile m_sourceFiles(MaxFiles);
Feb 8 '07 #2
AdrianH
1,251 Recognized Expert Top Contributor
Sorry,

The line of code that I am getting this error on is below:

private SourceFile m_sourceFiles(MaxFiles);
Are you writing in Java or C++? If in Java, you are in the wrong forum.

Otherwise, it looks like a Java to C++ transition error. In C++ you do not state a access modifier for each member variable and function, you specify it at the start of where you want it to apply to. If you were to specify it for each member, you would put a colon after the access modifier and prior to the member you are declaring. But you don't have to keep specifying it, the access modifier maintains its effect till you specify another one.

Hope this helps.


Adrian

PS Please put your code within a [code]...[/code] block. It makes it easier to read. Thanks.
Feb 8 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1658
by: Florian Preknya | last post by:
I work on building a metamodel from an UML diagram (serialized as xmi). There I have a class called Class that represents a class from the UML model. The Class has a name member and ininitially it...
7
12868
by: Tony Tone | last post by:
I am having trouble resolving this issue: Server Error in '/test' Application. -------------------------------------------------------------------------------- Compilation Error Description:...
9
17359
by: Jack | last post by:
I get the following errors from the code ( CRM 3.0 ) below, whats wrong ? Any suggestions are welcome because i'm kinda stuck here. The first error is pointing on the last bracket ] <--- ...
7
3187
by: VK | last post by:
I was getting this effect N times but each time I was in rush to just make it work, and later I coudn't recall anymore what was the original state I was working around. This time I nailed the...
10
9561
by: =?utf-8?b?QXNiasO4cm4gU8OmYsO4?= | last post by:
I came over this code which puzzled me. Isn't the enum supposed to have an identifier? enum { BT_CONNECTED = 1, /* Equal to TCP_ESTABLISHED to make net code happy */ BT_OPEN, BT_BOUND,...
4
44460
by: CodeTilYaDrop | last post by:
I am still pretty new to programming, and I sometimes can not figure something out. I am getting an error with this line in my program: Public void count_syllables(int count_syllables) I get...
2
4429
by: camzgon121 | last post by:
Hi guys, I have this code and when I try to compile and run it gives me an <identifier> expected error. The code with the irrelevant parts taken out. package ACCOUNT; import...
3
3469
oll3i
by: oll3i | last post by:
package ejb; import javax.ejb.EJBObject; import java.rmi.RemoteException; import java.sql.Connection; import java.util.Map; public interface InterfaceRemote extends EJBObject { public Map...
5
45002
by: nina01 | last post by:
Hi! I'm working on a mini compiler with flex and bison. The ".l" and ".y" files are generated successfully. However, when I try to compile the hole thing using the command "gcc -o comp comp.tab.c...
0
7229
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7129
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7333
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1566
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.