Any one know c++ language to retreive number from notepad fi
4 posters
pita :: PITA :: Pengaturcaraan
Page 1 of 1
Any one know c++ language to retreive number from notepad file and do some calculation ? FYP tajuk
Saya tidak pernah baca c++ coding pun? macam mana buat hor
ckwong- Novice
- Posts : 6
Join date : 2010-01-06
Age : 36
Location : Selangor
Re: Any one know c++ language to retreive number from notepad fi
maksud u?
panggil/import file notepad
check dalam file tu ada nombor atau tak?
whoz using C++ include u?
anyway: tak pernah guna C++
panggil/import file notepad
check dalam file tu ada nombor atau tak?
whoz using C++ include u?
anyway: tak pernah guna C++
Re: Any one know c++ language to retreive number from notepad fi
macam ambil nombor daripada notepad..dan buat pengiraan dalam visual c++ express edition 2008 ... Me and eng eng only use c++ language~
ckwong- Novice
- Posts : 6
Join date : 2010-01-06
Age : 36
Location : Selangor
Re: Any one know c++ language to retreive number from notepad fi
There are several ways to do that. First method is to use Win32 Console Application Project.
1) Select File > New > Win32 > Win32 Console Application
2) Enter name for the project such as testProject
3) A solution testProject will be created and the main file is testProject.cpp as highlighted in Solution Explorer window
4) Open the testProject.cpp file and enter the following code:
5) Right click on testProject project name, then select Add > New Item...
6) Select Text File (.txt) and name it as input
7) Open the input.txt file and type 2 number such as below :
Save All and press Ctrl + F5 to run the program
9) You will get this output : 25 + 40 = 65
1) Select File > New > Win32 > Win32 Console Application
2) Enter name for the project such as testProject
3) A solution testProject will be created and the main file is testProject.cpp as highlighted in Solution Explorer window
4) Open the testProject.cpp file and enter the following code:
- Code:
#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ifstream in ("input.txt"); // input file
int a, b;
in >> a >> b; // read from file
cout << a << " + " << b << " = " << a+b << endl; // write to console
return 0;
}
5) Right click on testProject project name, then select Add > New Item...
6) Select Text File (.txt) and name it as input
7) Open the input.txt file and type 2 number such as below :
- Code:
25 40
Save All and press Ctrl + F5 to run the program
9) You will get this output : 25 + 40 = 65
nkunda- Moderator
- Posts : 4
Join date : 2010-01-05
Re: Any one know c++ language to retreive number from notepad fi
wahhh~ i try first, tak tahu baru tanya kamu .... thank you
ckwong- Novice
- Posts : 6
Join date : 2010-01-06
Age : 36
Location : Selangor
Re: Any one know c++ language to retreive number from notepad fi
it is easier to use matlab....
Mr Sherlock Holmes- Script-Kiddies
- Posts : 10
Join date : 2010-01-09
Re: Any one know c++ language to retreive number from notepad fi
Sudah try code kamu~ boleh run dengan sama seperti gambar yang kamu buat, tapi saya tak tau macam mana apply dalam code saya...
Code saya buat ni tolong tengok kenapa tak ada calculation function ...semua keluar 0.0% ???
This is my code :
http://www.mediafire.com/?mjmjnymvinh
Code saya buat ni tolong tengok kenapa tak ada calculation function ...semua keluar 0.0% ???
This is my code :
http://www.mediafire.com/?mjmjnymvinh
ckwong- Novice
- Posts : 6
Join date : 2010-01-06
Age : 36
Location : Selangor
Re: Any one know c++ language to retreive number from notepad fi
Hai, siapa ada cd bagi Microsoft visual studio 6.0 ? Saya nak pinjam untuk install.... TQ ^^
ckwong- Novice
- Posts : 6
Join date : 2010-01-06
Age : 36
Location : Selangor
Re: Any one know c++ language to retreive number from notepad fi
act masalah kamu now adalah logic error. we cant help it cause u yang lebih faham prgoram tu patut buat apa. try debug dan lihat pada passing variable. mungkin boleh jumpa jawapannya
Re: Any one know c++ language to retreive number from notepad fi
Shafiq, So early wake up ready liao~ sembahyang leh.. Now got some idea to fix it, don't know work or not... My result have some number out liao.. haha but not accurate de la
ckwong- Novice
- Posts : 6
Join date : 2010-01-06
Age : 36
Location : Selangor
pita :: PITA :: Pengaturcaraan
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|