pita
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Any one know c++ language to retreive number from notepad fi

4 posters

Go down

Any one know c++ language to retreive number from notepad fi Empty Any one know c++ language to retreive number from notepad file and do some calculation ? FYP tajuk

Post by ckwong Wed Jan 06, 2010 11:50 am

Saya tidak pernah baca c++ coding pun? macam mana buat hor
ckwong
ckwong
Novice
Novice

Posts : 6
Join date : 2010-01-06
Age : 36
Location : Selangor

Back to top Go down

Any one know c++ language to retreive number from notepad fi Empty Re: Any one know c++ language to retreive number from notepad fi

Post by TMUkmkd Wed Jan 06, 2010 2:18 pm

maksud u?

panggil/import file notepad
check dalam file tu ada nombor atau tak?

whoz using C++ include u? Cool

anyway: tak pernah guna C++ Shocked
TMUkmkd
TMUkmkd
Moderator
Moderator

Posts : 21
Join date : 2010-01-05
Age : 36
Location : Uplink Agent Server

http://adamasalahbarunakcari.blogspot.com/

Back to top Go down

Any one know c++ language to retreive number from notepad fi Empty Re: Any one know c++ language to retreive number from notepad fi

Post by ckwong Wed Jan 06, 2010 3:26 pm

macam ambil nombor daripada notepad..dan buat pengiraan dalam visual c++ express edition 2008 ... Me and eng eng only use c++ language~
ckwong
ckwong
Novice
Novice

Posts : 6
Join date : 2010-01-06
Age : 36
Location : Selangor

Back to top Go down

Any one know c++ language to retreive number from notepad fi Empty Re: Any one know c++ language to retreive number from notepad fi

Post by nkunda Wed Jan 06, 2010 4:20 pm

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

Any one know c++ language to retreive number from notepad fi Sol_ex11

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...

Any one know c++ language to retreive number from notepad fi Step_210

6) Select Text File (.txt) and name it as input

Any one know c++ language to retreive number from notepad fi Step_310

7) Open the input.txt file and type 2 number such as below :
Code:
25 40

Cool Save All and press Ctrl + F5 to run the program

9) You will get this output : 25 + 40 = 65
nkunda
nkunda
Moderator
Moderator

Posts : 4
Join date : 2010-01-05

Back to top Go down

Any one know c++ language to retreive number from notepad fi Empty Re: Any one know c++ language to retreive number from notepad fi

Post by ckwong Thu Jan 07, 2010 8:24 am

wahhh~ i try first, tak tahu baru tanya kamu .... thank you
ckwong
ckwong
Novice
Novice

Posts : 6
Join date : 2010-01-06
Age : 36
Location : Selangor

Back to top Go down

Any one know c++ language to retreive number from notepad fi Empty Re: Any one know c++ language to retreive number from notepad fi

Post by Mr Sherlock Holmes Sat Jan 09, 2010 11:45 pm

it is easier to use matlab....

Mr Sherlock Holmes
Script-Kiddies
Script-Kiddies

Posts : 10
Join date : 2010-01-09

Back to top Go down

Any one know c++ language to retreive number from notepad fi Empty Re: Any one know c++ language to retreive number from notepad fi

Post by ckwong Sun Jan 10, 2010 12:18 am

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
ckwong
ckwong
Novice
Novice

Posts : 6
Join date : 2010-01-06
Age : 36
Location : Selangor

Back to top Go down

Any one know c++ language to retreive number from notepad fi Empty Re: Any one know c++ language to retreive number from notepad fi

Post by ckwong Wed Jan 13, 2010 12:29 am

Hai, siapa ada cd bagi Microsoft visual studio 6.0 ? Saya nak pinjam untuk install.... TQ ^^
ckwong
ckwong
Novice
Novice

Posts : 6
Join date : 2010-01-06
Age : 36
Location : Selangor

Back to top Go down

Any one know c++ language to retreive number from notepad fi Empty Re: Any one know c++ language to retreive number from notepad fi

Post by TMUkmkd Wed Jan 13, 2010 5:05 am

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
TMUkmkd
TMUkmkd
Moderator
Moderator

Posts : 21
Join date : 2010-01-05
Age : 36
Location : Uplink Agent Server

http://adamasalahbarunakcari.blogspot.com/

Back to top Go down

Any one know c++ language to retreive number from notepad fi Empty Re: Any one know c++ language to retreive number from notepad fi

Post by ckwong Wed Jan 13, 2010 5:48 am

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
ckwong
Novice
Novice

Posts : 6
Join date : 2010-01-06
Age : 36
Location : Selangor

Back to top Go down

Any one know c++ language to retreive number from notepad fi Empty Re: Any one know c++ language to retreive number from notepad fi

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum