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

Go down

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

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

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

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

View user profile

Back to top Go down

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

Post by TMUkmkd on 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

_________________
Trust is Weakness
avatar
TMUkmkd
Moderator
Moderator

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

View user profile http://adamasalahbarunakcari.blogspot.com/

Back to top Go down

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

Post by ckwong on 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~
avatar
ckwong
Novice
Novice

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

View user profile

Back to top Go down

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

Post by nkunda on 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



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

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

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

Posts : 4
Join date : 2010-01-05

View user profile

Back to top Go down

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

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

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

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

View user profile

Back to top Go down

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

Post by Mr Sherlock Holmes on 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

View user profile

Back to top Go down

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

Post by ckwong on 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 :


mediafire.com ?mjmjnymvinh
avatar
ckwong
Novice
Novice

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

View user profile

Back to top Go down

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

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

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

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

View user profile

Back to top Go down

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

Post by TMUkmkd on 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

_________________
Trust is Weakness
avatar
TMUkmkd
Moderator
Moderator

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

View user profile http://adamasalahbarunakcari.blogspot.com/

Back to top Go down

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

Post by ckwong on 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
avatar
ckwong
Novice
Novice

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

View user profile

Back to top Go down

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

- Similar topics

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