commit 67a2391619e72d82e98b11d9f0e257816211ffe7
Author: Damimani <41192030+Damimani@users.noreply.github.com>
Date: Sat Oct 24 09:35:47 2026 +0200
init
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d5219a8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,428 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+*.env
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+
+[Dd]ebug/x64/
+[Dd]ebugPublic/x64/
+[Rr]elease/x64/
+[Rr]eleases/x64/
+bin/x64/
+obj/x64/
+
+[Dd]ebug/x86/
+[Dd]ebugPublic/x86/
+[Rr]elease/x86/
+[Rr]eleases/x86/
+bin/x86/
+obj/x86/
+
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+[Aa][Rr][Mm]64[Ee][Cc]/
+bld/
+[Oo]bj/
+[Oo]ut/
+[Ll]og/
+[Ll]ogs/
+
+# Build results on 'Bin' directories
+**/[Bb]in/*
+# Uncomment if you have tasks that rely on *.refresh files to move binaries
+# (https://github.com/github/gitignore/pull/3736)
+#!**/[Bb]in/*.refresh
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+*.trx
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Approval Tests result files
+*.received.*
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+.artifacts/
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.idb
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+# but not Directory.Build.rsp, as it configures directory-level build defaults
+!Directory.Build.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.tlog
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio 6 workspace and project file (working project files containing files to include in project)
+*.dsw
+*.dsp
+
+# Visual Studio 6 technical files
+*.ncb
+*.aps
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+**/.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+**/.fake/
+
+# CodeRush personal settings
+**/.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+**/__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+#tools/**
+#!tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+MSBuild_Logs/
+
+# AWS SAM Build and Temporary Artifacts folder
+.aws-sam
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+**/.mfractor/
+
+# Local History for Visual Studio
+**/.localhistory/
+
+# Visual Studio History (VSHistory) files
+.vshistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+**/.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
+
+# VS Code files for those working on multiple tools
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+!.vscode/*.code-snippets
+
+# Local History for Visual Studio Code
+.history/
+
+# Built Visual Studio Code Extensions
+*.vsix
+
+# Windows Installer files from build outputs
+*.cab
+*.msi
+*.msix
+*.msm
+*.msp
+
+# Official VS Code C# Dev Kit Extension exclusion
+#*.lscache
diff --git a/1003/1003.slnx b/1003/1003.slnx
new file mode 100644
index 0000000..52534d3
--- /dev/null
+++ b/1003/1003.slnx
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/1003/1003/1003.vcxproj b/1003/1003/1003.vcxproj
new file mode 100644
index 0000000..3ada692
--- /dev/null
+++ b/1003/1003/1003.vcxproj
@@ -0,0 +1,151 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 18.0
+ Win32Proj
+ {2df8eb88-3a9a-4710-82c2-d18b1d5d4298}
+ My1003
+ 10.0
+
+
+
+ Application
+ true
+ v145
+ Unicode
+
+
+ Application
+ false
+ v145
+ true
+ Unicode
+
+
+ Application
+ true
+ v145
+ Unicode
+
+
+ Application
+ false
+ v145
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Level3
+ true
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+ Level3
+ true
+ _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1003/1003/1003.vcxproj.filters b/1003/1003/1003.vcxproj.filters
new file mode 100644
index 0000000..4e6cec0
--- /dev/null
+++ b/1003/1003/1003.vcxproj.filters
@@ -0,0 +1,30 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+
+
+ Header Files
+
+
+
\ No newline at end of file
diff --git a/1003/1003/feladat1.cpp b/1003/1003/feladat1.cpp
new file mode 100644
index 0000000..da8aca3
--- /dev/null
+++ b/1003/1003/feladat1.cpp
@@ -0,0 +1,101 @@
+//Tóth Dániel Mátyás | IFPQYY | v1
+
+double feladat1(const char* s) {
+ if (s == nullptr)
+ {
+ return 0;
+ }
+ bool neg = false;
+ bool valid = true;
+ int e = 0;
+ int stage = 0;
+ double w = 0;
+ double f = 0;
+ int i = 0;
+
+ int n; //only exists here because it cries when its intialised in the switch
+
+ while (valid && (s[i] != '\0')) {
+ switch (s[i]) {
+ case ' ':
+ case '\r':
+ case '\n':
+ case '\t':
+ case '\f':
+ case '\v':
+ if (stage > 0) {
+ valid = false;
+ }
+ break;
+
+ case '+':
+ if (stage > 0) {
+ valid = false;
+ } else {
+ stage = 1;
+ }
+ break;
+ case '-':
+ if (stage > 0) {
+ valid = false;
+ } else {
+ stage = 1;
+ neg = true;
+ }
+ break;
+
+ case '.':
+ if (stage > 1) {
+ valid = false;
+ } else {
+ stage = 2;
+ }
+ break;
+
+ case 'e':
+ case 'E':
+ if (stage > 2) {
+ valid = false;
+ } else {
+ stage = 3;
+ }
+ break;
+
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ n = s[i] - '0';
+ if (stage < 2) {
+ stage = 1;
+ w = (w * 10) + n;
+ } else if (stage == 2) {
+ f = (f * 10) + n;
+ } else {
+ e = (e * 10) + n;
+ }
+ break;
+ default:
+ valid = false;
+ break;
+ }
+ i++;
+ }
+ while (f >= 1)
+ {
+ f = f / 10;
+ }
+ int pow = 1;
+ for (int j = 0; j < e; j++)
+ {
+ pow = pow * 10;
+ }
+ w = (w + f) * pow;
+ return neg ? -w : w;
+}
\ No newline at end of file
diff --git a/1003/1003/feladat1.h b/1003/1003/feladat1.h
new file mode 100644
index 0000000..221c4fb
--- /dev/null
+++ b/1003/1003/feladat1.h
@@ -0,0 +1,6 @@
+#pragma once
+#ifndef FELADAT1_H
+double feladat1(const char* s);
+#endif // !FELADAT1_H
+
+//Tóth Dániel Mátyás | IFPQYY | v1
\ No newline at end of file
diff --git a/1003/1003/main.cpp b/1003/1003/main.cpp
new file mode 100644
index 0000000..7d86e44
--- /dev/null
+++ b/1003/1003/main.cpp
@@ -0,0 +1,13 @@
+#include
+#include
+#include "feladat1.h"
+
+//Tóth Dániel Mátyás | IFPQYY | v1
+int main() {
+ double x;
+ const char* ert = ".5678";
+
+ x = feladat1(ert);
+ printf("\n%s -> %f", ert, x);
+ return 0;
+}
\ No newline at end of file
diff --git a/1003/UnitTest1/UnitTest1.cpp b/1003/UnitTest1/UnitTest1.cpp
new file mode 100644
index 0000000..1b9861b
--- /dev/null
+++ b/1003/UnitTest1/UnitTest1.cpp
@@ -0,0 +1,151 @@
+#include "pch.h"
+#include "CppUnitTest.h"
+#include
+
+//Tóth Dániel Mátyás | IFPQYY | v1
+
+using namespace Microsoft::VisualStudio::CppUnitTestFramework;
+
+namespace UnitTest1
+{
+ TEST_CLASS(UnitTest1)
+ {
+ public:
+
+ TEST_METHOD(FractionTest1)
+ {
+ Logger::WriteMessage("In feladat1");
+ char* input = " \n\t\t-1234.5678";
+ double exp = -1234.5678;
+ double ret = feladat1(input);
+
+ Assert::AreEqual(exp, ret);
+ }
+ TEST_METHOD(FractionTest2)
+ {
+ Logger::WriteMessage("In feladat1");
+ char* input = ".5678";
+ double exp = 0.5678;
+ double ret = feladat1(input);
+
+ Assert::AreEqual(exp, ret, 1e-9); //1e-9 for tolerance, cause the two numbers are not *exactly* the same, theres a tiny difference in the millionth fraction somehwo
+ }
+ TEST_METHOD(FractionTest3)
+ {
+ Logger::WriteMessage("In feladat1");
+ char* input = ".1234.5678";
+ double exp = 0.1234;
+ double ret = feladat1(input);
+
+ Assert::AreEqual(exp, ret, 1e-9);
+ }
+ TEST_METHOD(OrderTest1)
+ {
+ Logger::WriteMessage("In feladat1");
+ char* input = " -\n\t\t1234.5678";
+ double exp = 0;
+ double ret = feladat1(input);
+
+ Assert::AreEqual(exp, ret);
+ }
+ TEST_METHOD(OrderTest2)
+ {
+ Logger::WriteMessage("In feladat1");
+ char* input = " \n\t\t1234-.5678";
+ double exp = 1234;
+ double ret = feladat1(input);
+
+ Assert::AreEqual(exp, ret);
+ }
+ TEST_METHOD(OrderTest3)
+ {
+ Logger::WriteMessage("In feladat1");
+ char* input = " \n\t\t1234.56-78";
+ double exp = 1234.56;
+ double ret = feladat1(input);
+
+ Assert::AreEqual(exp, ret);
+ }
+ TEST_METHOD(OrderTest4)
+ {
+ Logger::WriteMessage("In feladat1");
+ char* input = " + 1234.56-78";
+ double exp = 0;
+ double ret = feladat1(input);
+
+ Assert::AreEqual(exp, ret);
+ }
+ TEST_METHOD(NoNumTest1)
+ {
+ Logger::WriteMessage("In feladat1");
+ char* input = " \n\t\t";
+ double exp = 0;
+ double ret = feladat1(input);
+
+ Assert::AreEqual(exp, ret);
+ }
+ TEST_METHOD(NoNumTest2)
+ {
+ Logger::WriteMessage("In feladat1");
+ char* input = "kulturálatlanság";
+ double exp = 0;
+ double ret = feladat1(input);
+
+ Assert::AreEqual(exp, ret);
+ }
+ TEST_METHOD(ExponentTest1)
+ {
+ Logger::WriteMessage("In feladat1");
+ char* input = "123e4";
+ double exp = 1230000;
+ double ret = feladat1(input);
+
+ Assert::AreEqual(exp, ret);
+ }
+ TEST_METHOD(ExponentTest2)
+ {
+ Logger::WriteMessage("In feladat1");
+ char* input = ".123e4";
+ double exp = 1230;
+ double ret = feladat1(input);
+
+ Assert::AreEqual(exp, ret);
+ }
+ TEST_METHOD(ExponentTest3)
+ {
+ Logger::WriteMessage("In feladat1");
+ char* input = "123.e4";
+ double exp = 1230000;
+ double ret = feladat1(input);
+
+ Assert::AreEqual(exp, ret);
+ }
+ TEST_METHOD(ExponentTest4)
+ {
+ Logger::WriteMessage("In feladat1");
+ char* input = "123E4";
+ double exp = 1230000;
+ double ret = feladat1(input);
+
+ Assert::AreEqual(exp, ret);
+ }
+ TEST_METHOD(ExponentTest5)
+ {
+ Logger::WriteMessage("In feladat1");
+ char* input = "123E.4";
+ double exp = 123;
+ double ret = feladat1(input);
+
+ Assert::AreEqual(exp, ret);
+ }
+ TEST_METHOD(ExponentTest6)
+ {
+ Logger::WriteMessage("In feladat1");
+ char* input = "12.3e4 ";
+ double exp = 123000;
+ double ret = feladat1(input);
+
+ Assert::AreEqual(exp, ret);
+ }
+ };
+}
diff --git a/1003/UnitTest1/UnitTest1.vcxproj b/1003/UnitTest1/UnitTest1.vcxproj
new file mode 100644
index 0000000..277753f
--- /dev/null
+++ b/1003/UnitTest1/UnitTest1.vcxproj
@@ -0,0 +1,192 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 18.0
+ {5768658D-5753-57BE-9F55-89088097DC31}
+ Win32Proj
+ UnitTest1
+ 10.0
+ NativeUnitTestProject
+
+
+
+ DynamicLibrary
+ true
+ v145
+ Unicode
+ false
+
+
+ DynamicLibrary
+ false
+ v145
+ true
+ Unicode
+ false
+
+
+ DynamicLibrary
+ true
+ v145
+ Unicode
+ false
+
+
+ DynamicLibrary
+ false
+ v145
+ true
+ Unicode
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ C:\Users\danit\Desktop\cpp\1003\1003;$(IncludePath)
+
+
+ true
+
+
+ false
+
+
+ false
+
+
+
+ true
+
+
+ Use
+ Level3
+ true
+ $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;%(PreprocessorDefinitions)
+ true
+ pch.h
+
+
+ Windows
+ $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)
+
+
+
+
+ true
+
+
+ Use
+ Level3
+ true
+ true
+ true
+ $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;%(PreprocessorDefinitions)
+ true
+ pch.h
+
+
+ Windows
+ true
+ true
+ $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)
+
+
+
+
+ true
+
+
+ Use
+ Level3
+ true
+ $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)
+ _DEBUG;%(PreprocessorDefinitions)
+ true
+ pch.h
+
+
+ Windows
+ C:\Users\danit\Desktop\cpp\1003\1003\x64\Debug;$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)
+ feladat1;%(AdditionalDependencies)
+
+
+
+
+ true
+
+
+ Use
+ Level3
+ true
+ true
+ true
+ $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)
+ NDEBUG;%(PreprocessorDefinitions)
+ true
+ pch.h
+
+
+ Windows
+ true
+ true
+ $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)
+
+
+
+
+ Create
+ Create
+ Create
+ Create
+
+
+
+
+
+
+
+
+ {2df8eb88-3a9a-4710-82c2-d18b1d5d4298}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1003/UnitTest1/UnitTest1.vcxproj.filters b/1003/UnitTest1/UnitTest1.vcxproj.filters
new file mode 100644
index 0000000..f041cae
--- /dev/null
+++ b/1003/UnitTest1/UnitTest1.vcxproj.filters
@@ -0,0 +1,30 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+
+
+ Header Files
+
+
+
\ No newline at end of file
diff --git a/1003/UnitTest1/pch.cpp b/1003/UnitTest1/pch.cpp
new file mode 100644
index 0000000..64b7eef
--- /dev/null
+++ b/1003/UnitTest1/pch.cpp
@@ -0,0 +1,5 @@
+// pch.cpp: source file corresponding to the pre-compiled header
+
+#include "pch.h"
+
+// When you are using pre-compiled headers, this source file is necessary for compilation to succeed.
diff --git a/1003/UnitTest1/pch.h b/1003/UnitTest1/pch.h
new file mode 100644
index 0000000..9d715b0
--- /dev/null
+++ b/1003/UnitTest1/pch.h
@@ -0,0 +1,12 @@
+// pch.h: This is a precompiled header file.
+// Files listed below are compiled only once, improving build performance for future builds.
+// This also affects IntelliSense performance, including code completion and many code browsing features.
+// However, files listed here are ALL re-compiled if any one of them is updated between builds.
+// Do not add files here that you will be updating frequently as this negates the performance advantage.
+
+#ifndef PCH_H
+#define PCH_H
+
+// add headers that you want to pre-compile here
+
+#endif //PCH_H
diff --git a/feladat2/UnitTest1/UnitTest1.cpp b/feladat2/UnitTest1/UnitTest1.cpp
new file mode 100644
index 0000000..cccf769
--- /dev/null
+++ b/feladat2/UnitTest1/UnitTest1.cpp
@@ -0,0 +1,156 @@
+//Tóth Dániel Mátyás | IFPQYY | v2
+#include "pch.h"
+#include "CppUnitTest.h"
+#include "feladat2.h"
+
+using namespace Microsoft::VisualStudio::CppUnitTestFramework;
+
+namespace UnitTest1
+{
+ TEST_CLASS(UnitTest1)
+ {
+ public:
+
+ //Works weirdly, seems like the test methods are not isolated in themselves in this instance, will need to create and destroy in every
+ //seperate test to guarantee they will work as intended. If only these were in classes instead of being global.....
+
+ TEST_METHOD(CreateTest1)
+ {
+ destroyfifo();
+ Assert::AreEqual(OK, createfifo(10));
+ destroyfifo();
+ }
+ TEST_METHOD(CreateTest2)
+ {
+ createfifo(10);
+ Assert::AreEqual(NOK, createfifo(10));
+ destroyfifo();
+ }
+ TEST_METHOD(DestroyTest1)
+ {
+ createfifo(10);
+ Assert::AreEqual(OK, destroyfifo());
+ }
+ TEST_METHOD(DestroyTest2)
+ {
+ destroyfifo();
+ Assert::AreEqual(NOK, destroyfifo());
+ }
+
+ TEST_METHOD(PushTest1)
+ {
+ destroyfifo();
+ createfifo(10);
+ Assert::AreEqual(OK, push('c'));
+ destroyfifo();
+ }
+ TEST_METHOD(PopTest1)
+ {
+ destroyfifo();
+ createfifo(10);
+ push('c');
+ Assert::AreEqual('c', (char)pop());
+ destroyfifo();
+ }
+ TEST_METHOD(PopTest2)
+ {
+ destroyfifo();
+ createfifo(10);
+ Assert::AreEqual(NOK, pop());
+ destroyfifo();
+ }
+ TEST_METHOD(PopTest3)
+ {
+ destroyfifo();
+ createfifo(10);
+ push('c');
+ Assert::AreEqual('c', (char)pop());
+ Assert::AreEqual(NOK, pop());
+ destroyfifo();
+ }
+ TEST_METHOD(PeekTest1)
+ {
+ destroyfifo();
+ createfifo(10);
+ push('c');
+ Assert::AreEqual('c', (char)peek());
+ Assert::AreEqual('c', (char)peek());
+ destroyfifo();
+ }
+ TEST_METHOD(PeekTest2)
+ {
+ destroyfifo();
+ createfifo(10);
+ Assert::AreEqual(NOK, pop());
+ destroyfifo();
+ }
+ TEST_METHOD(FreespaceTest1)
+ {
+ destroyfifo();
+ int s = 5;
+ createfifo(s);
+ for (int i = 0; i < s; i++)
+ {
+ push('t');
+ }
+ Assert::AreEqual(0, freespace());
+ destroyfifo();
+ }
+ TEST_METHOD(FreespaceTest2)
+ {
+ destroyfifo();
+ int s = 5;
+ createfifo(s);
+ for (int i = 0; i < s-1; i++)
+ {
+ push('t');
+ }
+ Assert::AreEqual(1, freespace());
+ destroyfifo();
+ }
+ TEST_METHOD(CapacityTest1)
+ {
+ destroyfifo();
+ int s = 5;
+ createfifo(s);
+ Assert::AreEqual(s, capacity());
+ destroyfifo();
+ }
+ TEST_METHOD(CapacityTest2)
+ {
+ destroyfifo();
+ int s = 5;
+ createfifo(s);
+ push('c');
+ Assert::AreEqual(s, capacity());
+ destroyfifo();
+ }
+
+ TEST_METHOD(ClearTest1)
+ {
+ destroyfifo();
+ createfifo(10);
+ push('c');
+ Assert::AreEqual(OK, clearfifo());
+ Assert::AreEqual(NOK, pop());
+ Assert::AreEqual(NOK, peek());
+ destroyfifo();
+ }
+ TEST_METHOD(ClearTest2)
+ {
+ destroyfifo();
+ Assert::AreEqual(NOK, clearfifo());
+ }
+ TEST_METHOD(EnlargeTest)
+ {
+ destroyfifo();
+ createfifo(2); //2
+ push('c'); //1
+ push('a'); //0
+ push('d'); //doubles
+ Assert::AreEqual(4, capacity());
+
+ }
+
+ };
+}
diff --git a/feladat2/UnitTest1/UnitTest1.vcxproj b/feladat2/UnitTest1/UnitTest1.vcxproj
new file mode 100644
index 0000000..9b9e950
--- /dev/null
+++ b/feladat2/UnitTest1/UnitTest1.vcxproj
@@ -0,0 +1,192 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 18.0
+ {5768658D-5753-57BE-9F55-89088097DC31}
+ Win32Proj
+ UnitTest1
+ 10.0
+ NativeUnitTestProject
+
+
+
+ DynamicLibrary
+ true
+ v145
+ Unicode
+ false
+
+
+ DynamicLibrary
+ false
+ v145
+ true
+ Unicode
+ false
+
+
+ DynamicLibrary
+ true
+ v145
+ Unicode
+ false
+
+
+ DynamicLibrary
+ false
+ v145
+ true
+ Unicode
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ C:\Users\danit\Desktop\cpp\feladat2\feladat2\feladat2;C:\Users\danit\Desktop\cpp\feladat2\feladat2;$(IncludePath)
+
+
+ true
+
+
+ false
+
+
+ false
+
+
+
+ true
+
+
+ Use
+ Level3
+ true
+ $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;%(PreprocessorDefinitions)
+ true
+ pch.h
+
+
+ Windows
+ $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)
+
+
+
+
+ true
+
+
+ Use
+ Level3
+ true
+ true
+ true
+ $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;%(PreprocessorDefinitions)
+ true
+ pch.h
+
+
+ Windows
+ true
+ true
+ $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)
+
+
+
+
+ true
+
+
+ Use
+ Level3
+ true
+ $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)
+ _DEBUG;%(PreprocessorDefinitions)
+ true
+ pch.h
+
+
+ Windows
+ C:\Users\danit\Desktop\cpp\feladat2\feladat2\feladat2\x64\Debug;$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)
+ feladat2;%(AdditionalDependencies)
+
+
+
+
+ true
+
+
+ Use
+ Level3
+ true
+ true
+ true
+ $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)
+ NDEBUG;%(PreprocessorDefinitions)
+ true
+ pch.h
+
+
+ Windows
+ true
+ true
+ $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)
+
+
+
+
+ Create
+ Create
+ Create
+ Create
+
+
+
+
+
+
+
+
+ {c0af2585-3697-4ad9-bd3a-67823343a675}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/feladat2/UnitTest1/UnitTest1.vcxproj.filters b/feladat2/UnitTest1/UnitTest1.vcxproj.filters
new file mode 100644
index 0000000..f041cae
--- /dev/null
+++ b/feladat2/UnitTest1/UnitTest1.vcxproj.filters
@@ -0,0 +1,30 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+
+
+ Header Files
+
+
+
\ No newline at end of file
diff --git a/feladat2/UnitTest1/pch.cpp b/feladat2/UnitTest1/pch.cpp
new file mode 100644
index 0000000..64b7eef
--- /dev/null
+++ b/feladat2/UnitTest1/pch.cpp
@@ -0,0 +1,5 @@
+// pch.cpp: source file corresponding to the pre-compiled header
+
+#include "pch.h"
+
+// When you are using pre-compiled headers, this source file is necessary for compilation to succeed.
diff --git a/feladat2/UnitTest1/pch.h b/feladat2/UnitTest1/pch.h
new file mode 100644
index 0000000..9d715b0
--- /dev/null
+++ b/feladat2/UnitTest1/pch.h
@@ -0,0 +1,12 @@
+// pch.h: This is a precompiled header file.
+// Files listed below are compiled only once, improving build performance for future builds.
+// This also affects IntelliSense performance, including code completion and many code browsing features.
+// However, files listed here are ALL re-compiled if any one of them is updated between builds.
+// Do not add files here that you will be updating frequently as this negates the performance advantage.
+
+#ifndef PCH_H
+#define PCH_H
+
+// add headers that you want to pre-compile here
+
+#endif //PCH_H
diff --git a/feladat2/feladat2.slnx b/feladat2/feladat2.slnx
new file mode 100644
index 0000000..9b2afb6
--- /dev/null
+++ b/feladat2/feladat2.slnx
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/feladat2/feladat2/feladat2.cpp b/feladat2/feladat2/feladat2.cpp
new file mode 100644
index 0000000..25b8523
--- /dev/null
+++ b/feladat2/feladat2/feladat2.cpp
@@ -0,0 +1,139 @@
+//Tóth Dániel Mátyás | IFPQYY | v2
+#include
+#include
+#include "feladat2.h"
+
+static unsigned char* fifo;
+static bool activefifo = false;
+static int head = 0;
+static int tail = 0;
+static int lngt = 0;
+static bool full = false;
+
+int createfifo(int s) {
+ if (activefifo || s <= 0 || !(fifo = (unsigned char*)malloc(sizeof(char) * s)))
+ {
+ return NOK;
+ }
+ activefifo = true;
+ head = 0;
+ tail = 0;
+ lngt = s;
+ full = false;
+ return OK;
+}
+
+int destroyfifo(void) {
+ if (!activefifo || fifo == nullptr)
+ {
+ return NOK;
+ }
+ free(fifo);
+ activefifo = false;
+ return OK;
+}
+
+static int enlargefifo(void) {
+ if (fifo == nullptr)
+ {
+ return NOK;
+ }
+ unsigned char* temp = fifo;
+ activefifo = false;
+ int headtemp = head;
+ int tailtemp = tail;
+ int templngt = lngt;
+ if (createfifo(lngt * 2) == -1)
+ {
+ fifo = temp;
+ activefifo = true;
+ return NOK;
+ }
+ int i = 0;
+ while (headtemp != tailtemp) {
+ fifo[i++] = temp[tailtemp];
+ tailtemp = (tailtemp + 1) % templngt;
+ }
+ head = templngt - 1;
+ return OK;
+}
+
+int push(char c) {
+ if (!activefifo || fifo == nullptr)
+ {
+ return -1;
+ }
+ if (full)
+ {
+ if (enlargefifo() == NOK) {
+ return NOK;
+ }
+ }
+ fifo[head] = c;
+ head = (head + 1) % lngt;
+ if (head == tail) {
+ full = true;
+ }
+ return OK;
+}
+
+
+int pop(void) {
+ if (!activefifo || (head == tail && !full) || fifo == nullptr)
+ {
+ return NOK;
+ }
+ int ret = fifo[tail];
+ tail = (tail + 1) % lngt;
+ return ret;
+}
+
+int clearfifo(void) {
+ if (!activefifo) {
+ return NOK;
+ }
+ head = 0;
+ tail = 0;
+ full = false;
+ return OK;
+}
+
+int freespace(void) {
+ if (!activefifo) {
+ return NOK;
+ }
+ if (full) {
+ return 0;
+ }
+ return lngt - ((head - tail + lngt) % lngt);
+}
+
+int capacity(void) {
+ if (!activefifo) {
+ return NOK;
+ }
+ return lngt * sizeof(char);
+}
+
+void debugfifo(void) {
+ if (!activefifo || fifo == nullptr) {
+ return;
+ }
+ for (int i = 0; i < lngt; ++i) {
+ if (full || (head < tail && (i > head || i <= tail)) || (i < head && i >= tail))
+ {
+ printf("%d: %02x \n", i, fifo[i]);
+ }
+ else
+ {
+ printf("%d: URES \n", i);
+ }
+ }
+}
+
+int peek(void) {
+ if (!activefifo || (head == tail && !full) || fifo == nullptr) {
+ return NOK;
+ }
+ return fifo[tail];
+}
\ No newline at end of file
diff --git a/feladat2/feladat2/feladat2.h b/feladat2/feladat2/feladat2.h
new file mode 100644
index 0000000..85dcb1f
--- /dev/null
+++ b/feladat2/feladat2/feladat2.h
@@ -0,0 +1,13 @@
+//Tóth Dániel Mátyás | IFPQYY | v2
+#pragma once
+#define OK 0
+#define NOK -1
+int createfifo(int s);
+int destroyfifo(void);
+int push(char c);
+int pop(void);
+int clearfifo(void);
+int freespace(void);
+int capacity(void);
+void debugfifo(void);
+int peek(void);
diff --git a/feladat2/feladat2/feladat2.vcxproj b/feladat2/feladat2/feladat2.vcxproj
new file mode 100644
index 0000000..3511a80
--- /dev/null
+++ b/feladat2/feladat2/feladat2.vcxproj
@@ -0,0 +1,151 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+
+
+
+
+
+
+
+ 18.0
+ Win32Proj
+ {a2f27c2b-a860-44db-b1ea-4fa4467bd633}
+ feladat2
+ 10.0
+
+
+
+ Application
+ true
+ v145
+ Unicode
+
+
+ Application
+ false
+ v145
+ true
+ Unicode
+
+
+ Application
+ true
+ v145
+ Unicode
+
+
+ Application
+ false
+ v145
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Level3
+ true
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+ Level3
+ true
+ _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+
+
\ No newline at end of file
diff --git a/feladat2/feladat2/feladat2.vcxproj.filters b/feladat2/feladat2/feladat2.vcxproj.filters
new file mode 100644
index 0000000..1a781cd
--- /dev/null
+++ b/feladat2/feladat2/feladat2.vcxproj.filters
@@ -0,0 +1,30 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+
+
+ Header Files
+
+
+
\ No newline at end of file
diff --git a/feladat2/feladat2/feladat2/feladat2.vcxproj b/feladat2/feladat2/feladat2/feladat2.vcxproj
new file mode 100644
index 0000000..5353666
--- /dev/null
+++ b/feladat2/feladat2/feladat2/feladat2.vcxproj
@@ -0,0 +1,151 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 18.0
+ Win32Proj
+ {c0af2585-3697-4ad9-bd3a-67823343a675}
+ feladat2
+ 10.0
+
+
+
+ Application
+ true
+ v145
+ Unicode
+
+
+ Application
+ false
+ v145
+ true
+ Unicode
+
+
+ Application
+ true
+ v145
+ Unicode
+
+
+ Application
+ false
+ v145
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Level3
+ true
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+ Level3
+ true
+ _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/feladat2/feladat2/feladat2/feladat2.vcxproj.filters b/feladat2/feladat2/feladat2/feladat2.vcxproj.filters
new file mode 100644
index 0000000..b9045ce
--- /dev/null
+++ b/feladat2/feladat2/feladat2/feladat2.vcxproj.filters
@@ -0,0 +1,30 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+
+
+ Header Files
+
+
+
\ No newline at end of file
diff --git a/feladat2/feladat2/main.cpp b/feladat2/feladat2/main.cpp
new file mode 100644
index 0000000..90f9f5f
--- /dev/null
+++ b/feladat2/feladat2/main.cpp
@@ -0,0 +1,27 @@
+//Tóth Dániel Mátyás | IFPQYY | v2
+#include
+#include "feladat2.h"
+
+int main() {
+ //things that are supposed to be reachable actually are
+ createfifo(10);
+ push('c');
+ char c = pop();
+
+ printf("%c\n", c);
+
+ //and things that are not supposed to be are not
+ //enlargefifo();
+
+ push('d');
+ push('e');
+ push('m');
+ c = pop();
+ debugfifo();
+
+
+
+ destroyfifo();
+
+ return 0;
+}
\ No newline at end of file
diff --git a/feladat3/feladat3.slnx b/feladat3/feladat3.slnx
new file mode 100644
index 0000000..6344232
--- /dev/null
+++ b/feladat3/feladat3.slnx
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/feladat3/feladat3/dataset/testin10.dat b/feladat3/feladat3/dataset/testin10.dat
new file mode 100644
index 0000000..8ac7eca
Binary files /dev/null and b/feladat3/feladat3/dataset/testin10.dat differ
diff --git a/feladat3/feladat3/dataset/testin100.dat b/feladat3/feladat3/dataset/testin100.dat
new file mode 100644
index 0000000..e5b3cb3
Binary files /dev/null and b/feladat3/feladat3/dataset/testin100.dat differ
diff --git a/feladat3/feladat3/dataset/testin10000.dat b/feladat3/feladat3/dataset/testin10000.dat
new file mode 100644
index 0000000..43d5279
Binary files /dev/null and b/feladat3/feladat3/dataset/testin10000.dat differ
diff --git a/feladat3/feladat3/dataset/testin5.dat b/feladat3/feladat3/dataset/testin5.dat
new file mode 100644
index 0000000..0bea184
--- /dev/null
+++ b/feladat3/feladat3/dataset/testin5.dat
@@ -0,0 +1 @@
+”kÜ~:#q/#
\ No newline at end of file
diff --git a/feladat3/feladat3/dataset/testin50.dat b/feladat3/feladat3/dataset/testin50.dat
new file mode 100644
index 0000000..abd7b60
--- /dev/null
+++ b/feladat3/feladat3/dataset/testin50.dat
@@ -0,0 +1 @@
+krc0ŽCÆâ.ri‰HŸH9S*9<
7s)oPMíLHYµ
D-Äy*&øp€O>*r]DFt^PßuXû+á!Ëëißù}±pƒUÎ8™?a'Óp(<
\ No newline at end of file
diff --git a/feladat3/feladat3/datasets.txt b/feladat3/feladat3/datasets.txt
new file mode 100644
index 0000000..9f323d6
--- /dev/null
+++ b/feladat3/feladat3/datasets.txt
@@ -0,0 +1,12 @@
+C:\Users\danit\Desktop\cpp\feladat3\feladat3\dataset\testin5.dat
+
+
+C:\nonexistent.dum
+C:\Users\danit\Desktop\cpp\feladat3\feladat3\dataset\testin10.dat
+
+C:\Users\danit\Desktop\cpp\feladat3\feladat3\dataset\testin50.dat
+C:\Users\danit\Desktop\cpp\feladat3\feladat3\dataset\testin100.dat
+
+C:\Users\danit\Desktop\cpp\feladat3\feladat3\dataset\testin10000.dat
+
+
diff --git a/feladat3/feladat3/feladat3.cpp b/feladat3/feladat3/feladat3.cpp
new file mode 100644
index 0000000..bb1d1b7
--- /dev/null
+++ b/feladat3/feladat3/feladat3.cpp
@@ -0,0 +1,73 @@
+// IFPQYY | Tóth Dániel Mátyás | V1
+#include
+#include
+#include "feladat3.h"
+using namespace std;
+
+int GetFilenames(int argc, char* argv[],
+ char infilenames[MYMAXFILES][MYMAXFN],
+ char outfilenames[MYMAXFILES][MYMAXFN]) {
+ if (argc != 2 || argv == nullptr || infilenames == nullptr
+ || outfilenames == nullptr) {
+ return NOK;
+ }
+
+ cout << "Parameter allomany:\n" << argv[1] << '\n';
+ ifstream argifs(argv[1]);
+ if (!argifs.is_open())
+ {
+ cout << "Nem lehet megnyitni a " << argv[1] << " nevu allomanyt\n";
+ return NOK;
+ }
+ int readAmount = 0;
+ int i = 0;
+ char buf[MYMAXFN-1];
+ cout << "Feldolgozando allomanyok:\n";
+ while (readAmount < 5 && argifs.getline(buf, MYMAXFN-1))
+ {
+ readAmount++;
+ ifstream inputfile(buf);
+ if (!inputfile.fail())
+ {
+ strncpy_s(infilenames[i], buf, strlen(buf)); //if these are not allowed I'm gonna blow up
+ strncpy_s(outfilenames[i], buf, strlen(buf));
+ strcat_s(outfilenames[i], ".srt");
+ cout << infilenames[i] << " " << outfilenames[i] << "\tOK\n";
+ i++;
+ }
+ else
+ {
+ cout << "<" << buf << ">" << "\tNOK\n";
+ }
+ }
+ argifs.close();
+ int status = OK;
+ if (i == 0)
+ {
+ status = NOK;
+ cout << "Ures\tNOK\n";
+ }
+ cout << "*DONE\n";
+ return status;
+}
+int SortFile(char* infn, char* outfn, unsigned char* buf,
+ unsigned short* pmin, unsigned short* pmax,
+ unsigned short* pavg, unsigned short* pn,
+ unsigned short bufsize = MYBUFSIZE, bool test = false) {
+
+ if (infn == nullptr || outfn == nullptr
+ || buf == nullptr || pmin == nullptr
+ || pmax == nullptr || pavg == nullptr
+ || pn == nullptr) // there has to be a better way than this
+ {
+ return NOK;
+ }
+ if (bufsize != 8192) //I guess?
+ {
+ return NOK;
+ }
+}
+
+static int ReadFile(char* filename, int bufsize) {
+
+}
\ No newline at end of file
diff --git a/feladat3/feladat3/feladat3.h b/feladat3/feladat3/feladat3.h
new file mode 100644
index 0000000..97f28e5
--- /dev/null
+++ b/feladat3/feladat3/feladat3.h
@@ -0,0 +1,15 @@
+// IFPQYY | Tóth Dániel Mátyás | V1
+#pragma once
+#define MYBUFSIZE 8192
+#define MYMAXVALUE 65535
+#define MYMAXFILES 5
+#define MYMAXFN 128
+#define OK 0
+#define NOK (-1)
+int GetFilenames(int argc, char* argv[],
+ char infilenames[MYMAXFILES][MYMAXFN],
+ char outfilenames[MYMAXFILES][MYMAXFN]);
+int SortFile(char* infn, char* outfn, unsigned char* buf,
+ unsigned short* pmin, unsigned short* pmax,
+ unsigned short* pavg, unsigned short* pn,
+ unsigned short bufsize = MYBUFSIZE, bool test = false);
diff --git a/feladat3/feladat3/feladat3.vcxproj b/feladat3/feladat3/feladat3.vcxproj
new file mode 100644
index 0000000..f37945e
--- /dev/null
+++ b/feladat3/feladat3/feladat3.vcxproj
@@ -0,0 +1,151 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 18.0
+ Win32Proj
+ {05ad42de-8f96-4351-b07d-784a20d752bd}
+ feladat3
+ 10.0
+
+
+
+ Application
+ true
+ v145
+ Unicode
+
+
+ Application
+ false
+ v145
+ true
+ Unicode
+
+
+ Application
+ true
+ v145
+ Unicode
+
+
+ Application
+ false
+ v145
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Level3
+ true
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+ Level3
+ true
+ _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpp20
+
+
+ Console
+ true
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/feladat3/feladat3/feladat3.vcxproj.filters b/feladat3/feladat3/feladat3.vcxproj.filters
new file mode 100644
index 0000000..fc823c4
--- /dev/null
+++ b/feladat3/feladat3/feladat3.vcxproj.filters
@@ -0,0 +1,30 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+
+
+ Header Files
+
+
+
\ No newline at end of file
diff --git a/feladat3/feladat3/main.cpp b/feladat3/feladat3/main.cpp
new file mode 100644
index 0000000..02deaee
--- /dev/null
+++ b/feladat3/feladat3/main.cpp
@@ -0,0 +1,27 @@
+// IFPQYY | Tóth Dániel Mátyás | V1
+#include "feladat3.h"
+#include
+using namespace std;
+
+int main(int argc, char* argv[]) {
+ char infn[MYMAXFILES][MYMAXFN];
+ char outfn[MYMAXFILES][MYMAXFN];
+ static unsigned char buf[MYBUFSIZE];
+ unsigned short minv, maxv, avgv, nv;
+ if (GetFilenames(argc, argv, infn, outfn) == NOK)
+ {
+ return(NOK);
+ }
+ /*for (int n = 0; (n < MYMAXFILES) && (infn[n][0] != '\0'); n++)
+ {
+ if (SortFile(infn[n], outfn[n], buf, &minv, &maxv, &avgv, &nv) == NOK)
+ return(NOK);
+ }*/
+ /*cout << argc;
+ for (size_t i = 0; i < argc; i++)
+ {
+ cout << '\n';
+ cout << argv[i];
+ }*/
+ return(OK);
+}
\ No newline at end of file