Yes that's because the same IDE (Visual C++ 2005 known also as Visual C++ 8.0) alows to compile your code as C or as C++. Also the compiler is invoked indirectly using a command-line interface that...
Type: Posts; User: zephon
Yes that's because the same IDE (Visual C++ 2005 known also as Visual C++ 8.0) alows to compile your code as C or as C++. Also the compiler is invoked indirectly using a command-line interface that...
No, it won't compile in C, at least not in Visual C++ 2005.
In C you can write
typedef struct {
int a;
}some_struct; to be able to use
some_struct n;
but if I write
struct some_struct{
int a;
};
some_struct n = {};
n.a will be 0;
I know this braces form of initialization is inherited from C and is supported for compatibility with C programs, but...
I've tried it and it made no difference if the first array was bigger than 2. If the first array was of size 1 or 2, then the second one would get random values. So I guess my assumption was correct....
With -ansi and -pedantic(MinGW) the value of *pi in
int *pi = new int; is 0. Then I've tried the following code
int main()
{
const int arr_size=2;
int *px = new int[arr_size];
...
I also get 0 0 13 with MinGW and with Digital Mars compiler.
For the array initialization I get the following compilation error with Digital Mars Compiler
int *px = new int[10]();
...
I've read in a book that "we can value-initialize the elements by following the array size by an empty pair of parentheses:"
int *pia = new int[10] ()
Also the same book states that the...
You should try searching for Pic microcontroller projects. Maybe you can find one that resembles your need.
Writing in text mode was the problem indeed. Now it's ok, the files are indentical as expected. Thanks vart.
I know I should check the number of bytes read and written. That's the way I wrote the...
I try to read from a file and to write to another file an arbitrary number of bytes
int main (int argc, char* argv[])
{
FILE * pFileR;
FILE * pFileW;
char buffer[32];