1) Yes.
2) There are pointers.
But they can only be used in so called 'unsafe' blocks.
Like this:
unsafe
{
Type: Posts; User: Shade
1) Yes.
2) There are pointers.
But they can only be used in so called 'unsafe' blocks.
Like this:
unsafe
{
You can't initialize members of a base class in the constructor of the derived class.
Members are initialized in the constructor: nData is initialized in A() (default ctor)
So you cannot...
a linked list is MUCH bigger than an array.
Why? Because oft the next and prev pointer (plus the first and last).
normally you have also a data pointer, that makes
n*sizeof(your...
you are wasting your time.
I tried once to optimize bubblesort but the speed depends on the compiler.
You have to turn on optimization otherwise a
if(a<b)
{
t=a;
a=b;
b=a;
first of all: kick out that ugly global vars!
never ever use them
there is a 'function' (actually it is often a macro) isdigit() in ctype.h
it's easy to use: you call it with your char as...
The only keyword that we do not need is class
Because struct is nearly the same as class.
I don't have the Standard right here (it's at home)
But function arguments are not evaluated in a defined order. And I don't see any reasons why it should be different with variadic functions.
...
you can use Improved Console which offers you simple graphics. It's not much, but for simple things it works fine :)
i use newl - which simply returns '\n'
I read some performance issues on gcc2.95
in which '\n' was 60 times faster than endl - so I thought, why use endl??
a flush is made when the buffer is...
Just an idea:
float f=rand()/100.0;
That's not a compiler, that's even not a parser!
if(!strcmp(str,"MainFunction")) strcpy(str,"main");
A compiler or interpreter is much more complex!
Ich think you should read some tutorials...
No!
in <iostream> everything is in the namespace std. std is a namespace, not a class!
ios is a typedef to hide ios_base! (which is a class)
But there are more differences - the implementation...
what if scanf() read EOF? Then getchar() will never return '\n'
x==0
or
x?0:1
No - there is no good way... Why do you ask?
WTF?
The STL is template-based, that means, it costs nothing to runtime!!
Header files only contain declarations!!
170KB means you compile in Debug Mode.
Or you have LINKED many libraries.
...
You can program OO-Programs in C too :)
It isn't that difficult.
But C is (nearly) a subset of C++, so why prefer it over C++? The only reason I can think of is, that no C++ Compiler is...
You say, it's a waste of time to use an int if you only need a char. But do you have heard about alignment or padding?
on 32bit intel systems an int is the fastest thing possible. So everything is...
On 32bit intel and amd is 4byte the magic word.
nearly everything is aligned to 4byte (you get a significant speed plus!)
so it is simple for optimizing.
In the Ctor of your class you can store pointers to the generated object in a list:
Class::Class(...)
{
objects.push_back(this); //objects is a list<Class*>
...
}
It's funny to read...
I think noone will change their minds, so why discussing?
I (and as I see some others) keep doing it like the gurus, and you JoeSixpack keep casting.
I have learned...
It's funny to read...
I think noone will change their minds, so why discussing?
I (and as I see some others) keep doing it like the gurus, and you JoeSixpack keep casting.
I have learned...
int* p;
p=(char*)malloc(100);
so what? Compiler says: failure!
But what is the benefit?
It's a false sense of security:
p=(int*)malloc(100);
int* p;
p=(char*)malloc(100);
so what? Compiler says: failure!
But what is the benefit?
It's a false sense of security:
p=(int*)malloc(100);
OK, my first solution should be clear:
CString substring = sub_str(temp);
The second one is more difficult (it is a C Solution :))
char substring[100];
sub_str(temp,substring);
the syntax for asm isn't always the same (I think the C++ standard includes a keyword asm, but every compiler has its own syntax)
for VC++
__asm {
xor eax, eax
}
or
__asm xor eax,eax