opgave5-3
This commit is contained in:
@@ -88,6 +88,7 @@
|
|||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<SDLCheck>false</SDLCheck>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
|
|||||||
@@ -1,6 +1,32 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
void main()
|
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 +1,2 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
void strCat(char* a, char* b);
|
||||||
Reference in New Issue
Block a user