忍者ブログ

J’avais vingt ans

(´・ω・`)

   

[PR]

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

支出リストちぇっかー

自営業者、副収入がないなど、月の収入が固定的な場合。
出費(変動費)は日々変化し易いのでこちらを記録していく。

支出の上限を設定

1日単位の上限では、たまたま出費が多い日があるだけで、余力がなくなるので、
日単位と週単位の上限を設定する。

例:
・日につき1000円
・週につき7000円

いまのソース・コード

https://gist.github.com/LilinYume/8933726
PR

ctimeヘッダで日付を取得

#include <iostream>
#include <ctime>

using namespace std;

struct stamp
{
time_t time_val;
struct tm *look_into;
int yy, mm, dd;

// 日付の取得
stamp()
{
time_val = time( NULL );
look_into = localtime( &time_val );

yy = look_into-> tm_year;
mm = look_into-> tm_mon;
dd = look_into-> tm_mday;
}
// スタンプする日付を渡す
void express( int &year, int &month, int &day )
{
const int year_diff = 1900;
const int mon_diff = 1;

yy += year_diff;
mm += mon_diff;

year = yy;
month = mm;
day = dd;
}
};
int main()
{
stamp tmp;
int y, m, d;
tmp.express( y, m, d );

cout << y << m << d << endl;

return 0;
}
  

アーカイブ

Copyright ©  -- J’avais vingt ans --  All Rights Reserved

Design by CriCri / material by DragonArtz Desighns / powered by NINJA TOOLS / 忍者ブログ / [PR]