diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..dfaeb8098d27b6b1477f634b1328bda09dbf5b30 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +Task2/Debug/ +Task2/.vs/Task2/v16/ipch/AutoPCH/ed0fb3a1931cfd4a/SOURCE.ipch +Task2/task2.txt diff --git a/Task2/.vs/Task2/v16/.suo b/Task2/.vs/Task2/v16/.suo index 9cccae2b72f431bf4b00ef92a73dfcbf091cc125..b1a396a3e654f71a2527a4ee3d5337858c3562f6 100644 Binary files a/Task2/.vs/Task2/v16/.suo and b/Task2/.vs/Task2/v16/.suo differ diff --git a/Task2/.vs/Task2/v16/Browse.VC.db b/Task2/.vs/Task2/v16/Browse.VC.db index 42e3702b2da7bd31cc0102847f07c8cf3685729d..e3e8a6e45366cb994d992670bf4cba5521353250 100644 Binary files a/Task2/.vs/Task2/v16/Browse.VC.db and b/Task2/.vs/Task2/v16/Browse.VC.db differ diff --git a/Task2/Source.c b/Task2/Source.c index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ae3954a82729490fb418b8fa38dedfab9ec1c824 100644 --- a/Task2/Source.c +++ b/Task2/Source.c @@ -0,0 +1,21 @@ +//File: E:\UNI\C\Semester2\Assignment\Task2 +//Name: Task 2 +//Date:28.01.2020 +//Description: Write a function that loads the contents of a given text file into memory. Once loaded into memory you +//should output the text to the Console Window.You are expected to use the �ToCompress.txt� file for this +//part of the assignment(which is provided for you on Blackboard). +#include <stdio.h> +#include <stdlib.h> +int main() +{ + char c; + FILE* fp = fopen("task2.txt", "r"); + while ((c = fgetc(fp)) != EOF) + { + printf("%c", c); + } + fclose(fp); + + return 0; + +} \ No newline at end of file diff --git a/Task2/Task2.vcxproj b/Task2/Task2.vcxproj index 63a077a1953d90f020cd8607722e80044b52526f..66c1a24a081e25d7936385cab31e920445944e5b 100644 --- a/Task2/Task2.vcxproj +++ b/Task2/Task2.vcxproj @@ -76,6 +76,8 @@ <Optimization>Disabled</Optimization> <SDLCheck>true</SDLCheck> <ConformanceMode>true</ConformanceMode> + <AdditionalIncludeDirectories>_CRT_SECURE_NO_WARNINGS.</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions> </ClCompile> <Link> <SubSystem>Console</SubSystem>