Information and Communication Technology Sayed Mahbub Hasan Amiri Dhaka Residential Model College Higher Secondary.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

1 CSCI N305 C Language Programming Welcome to CSCI N305! Compiling Your First Program Using Microsoft Visual Studio 2008.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
C Pre-Course Workshop Terence Lee QT406 -> PQ607
1 Session-I & II CSIT-121 Spring 2006 Session Targets Introducing the VC++.NET Solving problems on computer Programming in C++ Writing and Running Programs.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Using Visual C++ and Pelles C
Create A Visual Studio Template
Microsoft Visual Basic 2005 CHAPTER 12 Cell Phone Applications and Web Services.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
Create Database Tables
Computer Programming and Basic Software Engineering 9 Building Graphical User Interface Working with Unmanaged Code.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 22 Macros.
CS Tutorial 1 Getting Started with Visual Studio 2012 (Visual Studio 2010 are no longer available on MSDNAA, please choose Visual Studio 2012 which.
Intro to C++. Getting Started with Microsoft Visual Studios Open Microsoft Visual Studios 2010 Click on file Click on New Project Choose Visual C++ on.
Lecture Set 2 Part B – Configuring Visual Studio; Configuration Options and The Help System (scan quickly for future reference)
A1 Visual C++.NET Intro Programming in C++ Computer Science Dept Va Tech August, 2002 © Barnette ND & McQuain WD 1 Quick Introduction The following.
Creating a Project with C++ Builder
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 2 Creating A New Project Using HEW.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Computer Science I How to Configure Visual Studio.NET 2003 for C++ Colin Goble.
Our Environment We will exercise on Microsoft Visual C++ v.6 We will exercise on Microsoft Visual C++ v.6 because that is what we have in the univ. because.
Tutorial 11 Five windows included in the Visual Basic Startup Screen Main Form Toolbox Project Explorer (Project) Properties.
Active-HDL Interfaces Debugging C Code Course 10.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files.
Active-HDL Interfaces Building VHPI Applications C Compilation Course 9.
1 NORMA Lab. 7 Generating Reports More Display Options File: NORMA_Lab6.ppt. Author: T. Halpin. Last updated: 2009 June 9.
(for Visual C++) Created by Daniel Lee, Li Mengran (past tutors) Contributions: Loke Yan Hao (current tutor)
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
Using Microsoft Visual Studio C++ Express 2005 Name: Dr Ju Wang Ashwin Belle Course Resource:
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Using Advanced Options Lesson 14 © 2014, John Wiley & Sons, Inc.Microsoft Official Academic Course, Microsoft Word Microsoft Word 2013.
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
CMPF124: Basics Skills for Knowledge Workers Manipulating Windows GUI.
CS320n –Visual Programming More LabVIEW Foundations.
Using Visual Studio C++ Express Ron Gross A current copy of this can be found at or this direct linkhttp://tinyurl.com/2ucarothis.
LAB#1 CSC st semster H King Saud University College of Applied studies and Community Service Csc 1101.
Links take you to…  Different slides in your presentation  A different PowerPoint presentation  Any program - (Word can be used for example to complete.
Object Oriented Programming (OOP) LAB # 1 TA. Maram & TA. Mubaraka TA. Kholood & TA. Aamal.
Lab00-Getting Started with VC Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual.
Video in Macromedia Flash (Optional) – Lesson 121 Video in Macromedia Flash (Optional) Lesson 12.
Install a Windows Service Application Windows Development Fundamentals LESSON 3.2.
This is how you invoke the Microsoft Visual Studio 2010 Software. All Programs >> Microsoft Visual Studio 2010.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
Open project in Microsoft Visual Studio → build program in “Release” mode.
Intro Compiler Configuration and Sample Project Walkthrough (For Axiom CME11E9-EVB)
11 User Controls Beginning ASP.NET in C# and VB Chapter 8.
Creating a Web Site Creating a new Web site Defining and using folders Creating and editing Web pages Viewing pages in a Web browser.
Spell Checker web service (you build a web client that interacts with the service) The client uses a servlet class and a JSP page. The user passes information.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Unit 9 Seminar. Starting Reporting Services Reporting Service Started.
DEVRY CIS 170 C I L AB 1 OF 7 G ETTING S TARTED Check this A+ tutorial guideline at
Dive Into® Visual Basic 2010 Express
Development Environment Setup
Chapter 2: The Visual Studio .NET Development Environment
Great way to learn is by example so fire up Visual Studios C (at home make sure you custom install with C++ - no longer default) by Deborah R. Fowler.
Quick Start Guide for Visual Studio 2010
Lab 1 Introduction to C++.
1. Open Visual Studio 2008.
ms vısual studıo 2008-Introductıon TUTORIAL
Lab 1 Introduction to C++.
Our Environment We will exercise on Microsoft Visual C++ v.6
Double click Microsoft Visual Studio 2010 on the Computer Desktop
POS 408 Week 1 Individual Assignment Individual: Console Display Message//tutorfortune.com Click on below link to buy
Running a Java Program using Blue Jay.
Presentation transcript:

Information and Communication Technology Sayed Mahbub Hasan Amiri Dhaka Residential Model College Higher Secondary

Today's we start with a video

Create Project by Visual C++ Today’s lesson

 In this session we will learn how to use Visual C++ to build a sample C program.  We assume Visual C++ (Visual Studio) was successfully installed.Visual C++  Step: Launch Visual C++.  Step: Click File menu > New sub-menu > select Project… sub-menu. Using Visual C++ (2008)

 Step: select Win32 for the Project types > select Win32 Console Application for Templates.  Step: Enter the project Name > click OK button.  We just keep other settings to default. Using Visual C++

 Step: select Application Settings (or Next > button). Using Visual C++

 Step: select Empty project for Additional options > click Finish button.  Other settings set to default because we just want an empty Win32 console mode application. Using Visual C++

 Now, on the left pane we have one solution and in it we have one project that we just created.  First project creation will create the first solution automatically.  At this stage we just having an empty project. Using Visual C++

 Step: select the project root folder > right-click mouse > select Add sub-menu > select New Item… sub-menu.  We are going to add C a source file to the project. Using Visual C++

 Step: select Code for Categories > select C++ File (.cpp) for Templates.  Step: put the source file name with.c extension for the Name.  Step: change the Location if needed > click Add button.  If we do not put the.c extension, the file will be defaulted to.cpp which is C++ source file.  For C source code portability, we need to put.c manually in Visual C++. Using Visual C++

 Now we have an empty C source file on the right pane.  If the file is not opened, just double-click the file link on the left pane. Using Visual C++

#include int main(void) { int i, p; float x; char name[50]; printf("Key-in an integer, float and a string\n"); p = scanf("%d%f%s", &i, &x, name); printf("p = %i\n", p); return 0; }  Step: Write the following C source code to the source file. Using Visual C++

 Now the C source file has source code in it.  We are ready to build (compile and link) the project. Using Visual C++

 Step: select Build menu > select Compile sub-menu. Using Visual C++

 Optionally, we can directly build the solution ( Build Solution sub- menu) or we can just build the project ( Build exercise_1 in this case).  Both steps will compile and link the needed files.  However in this case we only have 1 solution and in it we only have 1 project and in it we only have 1 C source file!  There can be more than 1 solution and in 1 solution there can be more projects and in every projects there can be 100s or 1000s files!!! Using Visual C++

 The output of the compiling process can be seen in the Output window.  You can invoke the Output windows by clicking View menu and selecting Output sub-menu (or Alt + 2 ) – VS  We have to make sure there is no error (optionally and/or warning) else the project/program cannot be run. Using Visual C++

 Provided there is no error during the building, we are ready to run the program.  Step: click Debug menu > select Start Without Debugging sub-menu.  We are not going to debug this program but just to run it.  So we choose Start Without Debugging instead of Start Debugging. Using Visual C++

 Now the console windows launched, ready to accept our input.  Step: For the purpose of learning, key-in " E-1 Tiger" and press Enter key. Of course without the double quotes.  A space (whitespace) terminate C statement and in this case terminate an input. Using Visual C++

 What this program does is: Prompt user for inputs, assigns to p the value 3, to i the value 31, to x the value 5.242, and name contains the string " Tiger" and print p’s value. Using Visual C++

#include int main(void) { int i, p; float x; char name[50]; printf("Key-in an integer, float and a string\n"); p = scanf("%d%f%s", &i, &x, name); printf("p = %i, i = %i, x = %f, name = %s\n", p, i, x, name); return 0; } assigns to p the value 3, to i the value 31, to x the value 5.242, and name contains the string " Tiger".  Step: Replace the previous C source code with the following.  Step: re-build and re-run the project key-in E-1 Tiger and press Enter key  The details can be depicted as shown below. Using Visual C++

assigns to p the value 3, to i the value 31, to x the value 5.242, and name contains the string "Tiger".  The following is a sample output. Using Visual C++

#include int main(void) { int i, p; float x; char name[50]; printf("Key-in an integer, float and a string\n"); p = scanf("%d%f%s", &i, &x, name); printf("p = %i, i = %i, x = %f, name = %s\n", p, i, x, name); scanf("%2d%f%*d %[ ]", &i, &x, name); printf("i = %i, x = %f, name = %s\n", i, x, name); return 0; } Assigns 56 to i, to x, skips 0123, and places the string "56\0" in name E-1 Tiger a72  Step: next, try re-run the program and key-in another different inputs. Using Visual C++

For the second input: Assigns 56 to i, to x, skips 0123, and places the string "56\0" in name  The following is a sample output. Using Visual C++

 In the following steps, we are going to use the default extension.cpp and then 'force' compiler to compile the program as C code.  Step: Close the previous Solution: select File menu > select Close Solution.  Step: Create new empty Win32 console mode application project as done previously. Using Visual C++

 Step: click Application Settings or click Next > button. Using Visual C++

 Step: select Empty project tick box > click Finish button.  Left other settings as default. Using Visual C++

 Step: add the source file. Select the project root folder > right-click mouse > select Add sub-menu > select New Item sub-menu. Using Visual C++

 Step: However in this step we are not adding the.c extension (Visual C++ will add.cpp by default) Using Visual C++

#include int main(void) { printf("%#x:\t%#x\n", 141); printf("%g:\t%g\n", ); printf("%07d:\t%07d\n", 123); printf("%+d:\t%+d\n", 456); printf("%-7d:\t%-7d,%-5d:\t%-5d,\n", 33, 44); printf("%7s:\t%7s\n", "123456"); printf("%s:\t%s\n", "my name"); printf("%4f:\t%4f\n", ); printf("%8.5f:\t%8.5f\n", ); printf("%.3f:\t%.3f\n", ); printf("%hd:\t%hd\n", 7); printf("%ld:\t%ld\n", 9); printf("%Lg:\t%Lg\n", ); return 0; }  Step: Copy and paste the following C source code. Using Visual C++

 In order to force this C source code built as C code we need to tell compiler to do so for this project.  Step: select Project menu > select your_project_name Properties… sub-menu. Using Visual C++

 Step: expand the Configuration Properties folder > expand the C/C++ sub-folder > select Advanced link from the left pane.  Step: on the right pane, for Compile As option, select Compile as C Code (/TC) > click OK button. Using Visual C++

 Step: Build the program as done previously. Make sure there is no error. Using Visual C++

 Step: run the program as done previously. Using Visual C++

 The following shows a sample output. Using Visual C++

 Compared to the previous example, the source file extension is.cpp instead of.c.  However, through the project settings we tell Visual C++ to build this C source code as C. Using Visual C++

Now we will see another Video