Anarion's Profile User Rating: -----

Reputation: 314 Architect
Group:
Author w/DIC++
Active Posts:
1,526 (0.72 per day)
Joined:
16-May 09
Profile Views:
35,105
Last Active:
User is offline Today, 06:48 AM
Currently:
Offline

Previous Fields

Country:
IR
OS Preference:
Linux
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
1150

Latest Visitors

Icon   Anarion has not set their status

Posts I've Made

  1. In Topic: Need some suggestions for my c++ project

    Posted 9 Feb 2015

    View PostSkydiver, on 09 February 2015 - 07:08 PM, said:

    So you want to build an Expert System... If you don't have to deal with fuzzy logic, you could conceptually just build a tree and navigate from the root (most common symptom) and work you way to the leaves (diagsosis).

    Good advice! I remember reading something similar in Management Information Systems.

    Quote

    Where should i put my database, in class or file or something else...

    Depends. If you want to have all the decision tree data hard-coded (I doubt you would want this), it should reside in a class. If you store the tree data in a file, you are able to manipulate the tree and add/remove decision data regardless of the program code.
  2. In Topic: C++ Call by reference

    Posted 5 Feb 2015

    I tried compiling your code, it compiles fine but has warnings:

    Quote

    ||=== forum, Debug ===|
    /home/anarion1191/Projects/C++/forum/main.cpp||In function ‘int main()’:|
    /home/anarion1191/Projects/C++/forum/main.cpp|22|warning: ‘ar’ may be used uninitialized in this function [-Wuninitialized]|
    /home/anarion1191/Projects/C++/forum/main.cpp|22|warning: ‘vl’ may be used uninitialized in this function [-Wuninitialized]|
    /home/anarion1191/Projects/C++/forum/main.cpp|23|warning: ‘ar2’ may be used uninitialized in this function [-Wuninitialized]|
    /home/anarion1191/Projects/C++/forum/main.cpp|23|warning: ‘vl2’ may be used uninitialized in this function [-Wuninitialized]|
    /home/anarion1191/Projects/C++/forum/main.cpp|24|warning: ‘totvol’ may be used uninitialized in this function [-Wuninitialized]|
    ||=== Build finished: 0 errors, 5 warnings ===|


    Are you sure you are getting errors with the code you wrote here?
  3. In Topic: Structure Help

    Posted 5 Feb 2015

    Not sure if I understood it correctly, I guess you want to change from char to string? If this is the case, you should be using std::string:
    struct Auto
    {
    	string partnum;
    	string partdesc;
    	string vehiclemake;
    	string vehiclemodel;
    	string engine;
    	int year;
    } partentry[50];
    

    And change the rest of your code accordingly.

    But judging from the code and the requirements, I believe you are limited to C-like C++. In this case, you should read up on using char-arrays in C++, it's a good tutorial to begin with ;)
  4. In Topic: issue with templates

    Posted 31 Jan 2015

    View Postmegagig, on 01 February 2015 - 12:08 AM, said:

    Oh wow thank you!!! Yeah our instructor drills into us to NOT put code in the header file :P/>

    Your instructor actually has a good point in that, but it only works for non-template classes (given the way your code currently is). Here you can find good information on this situation and possible methods to cope with it.
  5. In Topic: C++ code reading a file into an array then reversing the array

    Posted 22 Jan 2015

    In addition to jimblumberg's post, you are doing the file input wrong. Notice:
    	ifstream fin ("numbers.dat");  
    
    	//some code
    
    	while (!fin.eof() && position < array_size)
    	{	
    		//some code
    	}
    

    The reason is that in C++ file streams, eof is accessible as an error flag (notice how it is used: fin.eof() which returns a bool value). It is only set to true when the object tries to read past the end-of-file character. You should change the loop to something like this:
    	ifstream fin("numbers.dat");
    	//some code, also checks to see if the file is opened without errors
    	double num[array_size]; //assuming array_size was initialized prior to this line
    	std::size_t count = 0;
    	while(fin>>num[count] && count < array_size) {
    		++count;
    	}
    

    You should read up on formatted input vs. non-formatted input in C++.

My Information

Member Title:
The Persian Coder
Age:
22 years old
Birthday:
May 17, 1992
Gender:
Interests:
Music, Tennis, Programming, KitKat, Cars, Bikes
Full Name:
Kian Nezhadfard
Years Programming:
~5
Programming Languages:
Good At: C++
Know some: PHP, Bash
Learning: Python, R

Contact Information

E-mail:
Private
Twitter:
http://twitter.com/anarion1191

Comments

Page 1 of 1
  1. Photo

    Hybrid SyntaX Icon

    10 Feb 2014 - 14:02
    sup?
  2. Photo

    estherNamogo Icon

    03 Nov 2013 - 06:33
    Hello
    Nice to meet you write
    me at (esther2namogo@hotmail.com) i will send you my picture OK.
  3. Photo

    jatinjindalj Icon

    06 Sep 2012 - 09:01
    Hey Regarding your code snippet at
    http://www.dreamincode.net/code/snippet4621.htm-->
    Can you please explain:
    why when at line 37 and 38,If I do
    while(q!= NULL) {//Line 37
    q = q->link;
    }
    t = new node;
    t->data = str;
    t->link = NULL;<...
  4. Photo

    Anarion Icon

    07 Aug 2012 - 06:23
    Thanks! I had made it for DIC Signature Contest and put it on my sig since then.
  5. Photo

    AnalyticLunatic Icon

    06 Aug 2012 - 09:05
    Just wanted to drop by and say Sweet Sig. Sometime I need to make one for myself.
  6. Photo

    David W Icon

    07 Jun 2012 - 00:31
    Shalom shalom my Regal Persian Coder Friend
  7. Photo

    Anarion Icon

    16 Mar 2011 - 00:56
    @abrsefid: ba arze sharmandegi, komaki az man sakhte nist. Az beine portha faghat ba USB kar kardam oon ham dar sathe kheili payin. Be shoma pishnahad mikonam baraye javabe soaletun dar internet jostejoo konid :)
  8. Photo

    yogesh201010 Icon

    05 Mar 2011 - 18:41
    hi i am yogesh
    how to connect internet by mob in linux.
    and tell me book for linux learning
    thanks
  9. Photo

    abrsefid Icon

    27 Feb 2011 - 05:23
    salam man donbale 1 code c++ (ubuntu) migardam vase send o receive data ba port serial mishe rahnamaeem konid ?
  10. Photo

    hamishehiran Icon

    10 Aug 2010 - 23:02
    thanks for add! ;) nice to meet you!
  11. Photo

    Anarion Icon

    28 Mar 2010 - 08:27
    Thanks! Happy new year to you too :)
  12. Photo

    saSBH2 Icon

    28 Mar 2010 - 07:03
    Happy New Year :)
Page 1 of 1