Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/test/browser/test_manual_download_data.c
4150 views
1
// Copyright 2017 The Emscripten Authors. All rights reserved.
2
// Emscripten is available under two separate licenses, the MIT license and the
3
// University of Illinois/NCSA Open Source License. Both these licenses can be
4
// found in the LICENSE file.
5
6
#include <stdio.h>
7
#include <string.h>
8
#include <assert.h>
9
10
int main()
11
{
12
FILE *handle = fopen("file.txt", "r");
13
char str[128] = {};
14
fread(str, 1, sizeof(str), handle);
15
printf("str: %s\n", str);
16
int success = (strcmp(str, "Hello!") == 0);
17
assert(success);
18
printf("OK\n");
19
return 0;
20
}
21
22