opgave5-3

This commit is contained in:
2016-02-03 11:17:31 +01:00
parent 43a4041283
commit a250a209aa
3 changed files with 28 additions and 0 deletions
+1
View File
@@ -88,6 +88,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>false</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
+26
View File
@@ -1,6 +1,32 @@
#include "main.h"
#include <stdio.h>
#include <string.h>
void main()
{
char string[100];
int result = strcpy(string, "test");
printf("result %d, string %s\n", result, string);
char s1[100];
strcpy(s1, "remco");
char s2[100];
strcpy(s2, "kenneth");
strCat(&s1, &s2);
printf("Nieuw string: %s\n", s1);
}
void strCat(char* a, char* b)
{
int i, j;
i = j = 0;
while (a[i] != '\0')
i++;
while((a[i++] = b[j++]) != '\0')
;
}
+1
View File
@@ -1 +1,2 @@
#pragma once
void strCat(char* a, char* b);