Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 3cfe33fe4b918e6bf0b982ed89c4b1942af5f1fa (plain) (blame)
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
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html lang="en">
<head>
  <meta http-equiv="Content-Language" content="en-us">
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>Creating a C/C++ file</title>
  <link rel="stylesheet" type="text/css" href="../help.css">
  <script language="JavaScript">
function changeSize(theImage,wd,ht) {
	wdth=parseInt(theImage.style.width); hght=parseInt(theImage.style.height);
	if ( !(wdth==(wd*2)) ) {wdth=wd*2; hght=ht*2;}
	else {wdth=wd;hght=ht;}
	theImage.style.width=wdth; theImage.style.height=hght;
}
  </script>
</head>
<body>
<h1>Creating a C/C++ file</h1>
<p>Files are edited in the C/C++ editor that is, by default, located in
the editor area to the right of the <a href="../reference/cdt_u_project_explorer_view.htm">Project Explorer</a> or <a href="../reference/cdt_u_cproj_view.htm">C/C++ Projects</a> views.</p>
<p>The marker bar on the left margin of the C/C++ editor, displays
icons for errors, warnings, bookmarks, breakpoints and tasks.</p>
<p>For more information on the marker bar, see <strong>Workbench User Guide
&gt; Reference &gt; User interface information &gt; Views and editors
&gt; Editor area</strong>.</p>
<h3>To create a C++ file:</h3>
<ol>
  <li>In the <strong>Project Explorer</strong> or <strong>C++ Projects</strong> view, right-click a project, and
select <strong>New &gt; File</strong>.<br>
    <img src="../images/project_new_file.png"
 alt="New &gt; File in Projects View"></li>
  <li>In the list of projects, verify that the correct project is
selected.</li>
  <li>In the <strong>File name</strong> box, type a name followed by the
appropriate extension.</li>
  <li>Click <strong>Finish</strong>.<br>
    <img src="../images/project_new_file_name.png" alt="New File Wizard"></li>
  <p>The file will open in the C/C++ editor.</p>
  <li>Enter your code in the editor view.<br>
    <img src="../images/project_new_cppfile.png" alt="Editor view with a sample code"></li>
  <li>Type <strong>CTRL+S</strong> to save the file.</li>
</ol>
<p><img border="0" src="../images/ngconcepts.gif" alt="Related concepts"
 width="143" height="21">
<br>
<a href="../concepts/cdt_c_projects.htm">CDT Projects</a><br>
<a href="../concepts/cdt_c_proj_file_views.htm">Project file views</a>
</p>
<p><img border="0" src="../images/ngtasks.gif" alt="Related tasks"
 width="143" height="21">
<br>
<a href="cdt_t_show_proj_files.htm">Displaying C/C++ file components in
the C/C++ Projects view</a><br>
<a href="cdt_t_prvw_hide_files.htm">Hiding files by type in the C/C++
Projects view</a></p>
<p><img border="0" src="../images/ngref.gif" alt="Related reference"
 width="143" height="21">
<br>
<a href="../reference/cdt_o_proj_prop_pages.htm">Project properties</a></p>
<hr >
<p>
<img src="../images/ng00_04a.gif" alt="IBM Copyright Statement"></p>
</body>
</html>

Back to the top