|
-
Jan 22nd, 2002, 07:37 PM
#1
Thread Starter
Hyperactive Member
asm + c++
what is the usefulness of using assembly in c++? speed?
thanks
Amon Ra
The Power of Learning.
-
Jan 22nd, 2002, 08:52 PM
#2
Speed, confusion (to the un-initiated =), the ability to look cool, the best way to destroy code portability... Lots of reasons =).
Z.
-
Jan 22nd, 2002, 09:06 PM
#3
I gotta say, im kinda tired of these kind of questions.
-
Jan 22nd, 2002, 09:30 PM
#4
transcendental analytic
You should not learn assembly in conjunction with C++, it's already a mess as it is. If you want to look cool go ahead, but if you want any results, stay away from assembly.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jan 22nd, 2002, 10:35 PM
#5
Thread Starter
Hyperactive Member
ok i will follow then... =) sorry chimpface, i just wanted to know
Amon Ra
The Power of Learning.
-
Jan 22nd, 2002, 10:45 PM
#6
Ther will forever be questions that will be answered over and over. "C++, or Java?", "D3D or OGL?", "Is there really a God?"... Nothing will do except to swallow an angry RTFM, and answer.
Z.
PS: no offense, Amon Ra, just observing the kind of posts that I have seen in other places =).
-
Jan 22nd, 2002, 10:58 PM
#7
transcendental analytic
There's no good answer for everyone, only an answer for someone, so althought it looks like the same question, it depends on who asks it. I gotta say that i've been answering same questions in different ways as I start to think in new ways, good thing about learning is that you'll become familiar with the subjectivity of all matters...
lol, wasn't really what I was going to say, but doesn't matter
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jan 22nd, 2002, 11:05 PM
#8
Thread Starter
Hyperactive Member
how would you tell if someone used c++ or c? (besides the OOP stuff)?
Amon Ra
The Power of Learning.
-
Jan 23rd, 2002, 12:16 AM
#9
Thread Starter
Hyperactive Member
could i get some good tuts for c? thanks
Amon Ra
The Power of Learning.
-
Jan 23rd, 2002, 06:56 AM
#10
No classes, the lack of exceptions, an exclusive use of malloc, are all good clues as to whether a program is C, or C++.
Z.
-
Jan 23rd, 2002, 08:51 AM
#11
Lively Member
Don't bother learning C before C++, just go straight into C++.
Learn OO programming techniques.
Learning C programming will make it harder to learn OO in C++.
-
Jan 23rd, 2002, 10:44 AM
#12
Thread Starter
Hyperactive Member
Amon Ra
The Power of Learning.
-
Jan 23rd, 2002, 12:48 PM
#13
Monday Morning Lunatic
Originally posted by kedaman
OOP stuff, and Generic Stuff, exceptions as Zaei mentioned and new instead of malloc, C++ is backward compatible which allows C programmerse to program in C++, and just by experience you can show who's been using what.
Not totally. This is valid C code (not for much longer if the standard gets its act together!):
Code:
#include <stdio.h>
#include <stdlib.h>
main() {
int *ptr = malloc(5 * sizeof(int));
for(int i = 0; i < 5; ++i) {
printf("%d", ptr[i]);
}
free(ptr);
return 0;
}
Just try and compile that in a C++ compiler
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jan 23rd, 2002, 03:18 PM
#14
Even if you can't derive it from the not-using of classes and such, there are some things that will help you. Parksies code for example would be neither C nor C++ by the exact standards . C++ standard does not allow this line:
int *ptr = malloc(5 * sizeof(int));
You need an explicit cast when casting a void* (as returned by malloc) to any other pointer type.
neither does it allow this line:
main()
Every function needs a defined return type, C just assumes int.
C standard does not allow this line:
for(int i = 0; i < 5; ++i)
variables may only be declared at the start of a block, that is, directly after an opening { bracket. You would have to write:
main()
{
int i;
// ...
for(i = 0; i < 5; ++i)
{
// variables may be declared here
// ...
}
}
Another thing:
typedef struct
{
// members:
int i, s, e;
} MYSTRUCT;
This will only appear in code that was made to work with C, so you don't have to write
struct MYSTRUCT st;
Exclusive use of /* such */ comments is also a sign of C code. (Although most C compilers now support // and the current C standard requires it).
That's all I can think of at the moment.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|