I know that both code is the same, and I also know that a string is actually an array of characters.
What I meant was that I want to assign a pointer char array, so I can have some sort of string...
Type: Posts; User: kevinv2u
I know that both code is the same, and I also know that a string is actually an array of characters.
What I meant was that I want to assign a pointer char array, so I can have some sort of string...
Ok, I've changed my code.
Now, when I use:
char *test;
test = "hello";
strcpy(Buff, test);
I've got the following code so far for a char array:
static HANDLE hFileMap;
static char *Buff[2];
// Create File Mapping (use invalid handle, don't link to real file, +1 for...
Ok, that works! Thanks!
If anyone can use it, here is the code:
static HANDLE hFileMap;
static char *Buff = NULL;
// Create File Mapping (use invalid handle, don't link to real...
I've got a bit of a mess right now...sorry for that!
static HANDLE hFileMap;
static unsigned long *Buff = NULL;
// Create File Mapping (use invalid handle, don't link to real file,...
See last message...
Hi,
I'm working on an assignment in which I have to use a memory mapped file.
In another assignment I've done this before like this:
static unsigned long *Buff = NULL;
static HANDLE...
Thanks! I've modified my code...
You mean that I have to define BUFSIZE in my code as such?:
#define BUFSIZE 80
It's not part of my assignment to allocate a dynamic buffer. It's a personal choice of mine.
I can declare the buffer as such: 'char buffer[80]' and read a text file into this buffer. That would...
Yes, I do...
I've got experience with various languages (.NET, Java, VB6, PHP) and operating systems.
C is quite a bit different though...:D
What about using filelength functions, and using this to allocate the buffer?
Is that an option? Or would this be a dirty solution?
I need to use read beause of an assignment. We need to use direct system calls for handling files.
The static buffer size is not a problem for my school assignment, but I'm personally not happy...
Hi All,
I'm new to C-programming, and I'm trying to read a text file.
Here's my code so far.
#include <stdio.h>
2 #include <stdlib.h>