Jump to content

exotic types

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
25 replies to this topic

#1
Guest_h4x_*

Guest_h4x_*
  • Guests
for me, c should contain only:

signed/unsigned:
byte = 1 byte
dbyte = 2 bytes
qbyte = 4 bytes
obyte = 8 bytes
d like double, q like quad, o like octal.

dbyte a, b;

a = b = syntax error
*ds:a = b should be mov dword [ds:a],dword b
*ds:a = *es:b = mov eax,dword [es:b]/mov dword [ds:a],eax
like in assembler.


and thats it.
for more complex types make structures.
cpu dont operate on other.



So why there are milions of types like size_t, lpword, u_int, and many many many others. Why not make c simple? Too many unclear types that even google had problem deciphering is main reason why i despise c and laugh at anyone having problems with it.

#2
Guest

Guest

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,414 posts
I usually just use int, float, double, char. I avoid making things more complicated than they have to be.
Root Beer == System Administrator's Beer
Download the new operating system programming kit! (some assembly required)

#3
Guest_h4x_*

Guest_h4x_*
  • Guests
oh yes, also add fpu to the list.

#4
ZekeDragon

ZekeDragon

    Writes binary right handed and hex left handed

  • Moderators
  • 2,103 posts
You realize that the types you cited as examples of complex types (size_t, u_int) are just typedefs of standard types (like int), right? The reason it's done like that is because of implementation specific details, such as size_t possibly being something other than an int (in the case of 64-bit implementations). There's nothing complex about these. O_o
Wow I changed my sig!

#5
Guest_h4x_*

Guest_h4x_*
  • Guests
belive me, if you have no idea if its 8 or 4 bytes, and later you fing out its 996 bytes you get frustrated.

#6
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
One of the goals of C is to abstract away some of the hardware details. If you want to work that close to the hardware, stay on assembly.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#7
TkTech

TkTech

    The Crazy One

  • Moderators
  • 1,396 posts
Sadly h4x, you're incompetent, constantly hammering x86 for not being what you expect it to be - maybe if you stopped refusing to read the manuals, it would make sense.

Same with C. You don't seem to understand even the basics, and would rather the world become perfect for you. Enjoy even more -rep.

On another note, C is simple. Its very simple, much easier then most functional languages and easier then many other languages. Simply because you find it challenging (likely along the lines of having to change your diaper) does not make it so for the average population.

#8
Guest_h4x_*

Guest_h4x_*
  • Guests
ok simple task, execute lock instruction in c.
GOOD LUCK.

c is good as showing to someone how algo works, nothing more.
if you think hardware independent then ur incompetent to translate the code.

#9
dcs

dcs

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 775 posts

h4x said:

ok simple task, execute lock instruction in c.
What good does that do me on all the platforms I code for that do not have a lock instruction?

Like WingedPanther said, if you need assembly, use assembly. If you would like to understand C, take the time to learn it.

[edit]File this thread under vaxocentrism, circa 2000: "all the world's a PC". :rolleyes:

#10
Guest_h4x_*

Guest_h4x_*
  • Guests
perhaps we differ in it.

i prefer to have lots of code, and errors that i know what they mean and how to solve them.
In c, you have nothing. Many many versions of it, you have to worry about each header file, most harder features are really big pain in the ass. You have usually tons of meanless files, wich you have to waste hours to understand. And in most cases constants are not constant and 0 is 1 on other ssytem, thus creating race condition bugs or even size mismatches. Yes it is easy when you have nice multi-gigabyte IDE written by micro$oft and all you have to worry is a bsod here and then, code is generated by itself, almost... And not forget this awesome size and speed, hello world can be up to 800 times larger than it should be.

I really had bad past with c, it is my enemy, as other stupid thing made to make life easier. Sorry, wrong approach, FAIL, let me do the job.

#11
fantanoice

fantanoice

    Newbie

  • Members
  • PipPip
  • 26 posts
The best way to give types more 'meaning' is to use typedefs.

But anyway, you're saying a programming language made in the 70's is hard and complicated. Considering it was made in the stone age where standards didn't exist, it's not hard to see why there's so much nonsense with it.

And naturally my Uni decided we'd learn it, simply because it's so tricky. -_-


If you want simple C, maybe try C++? :P

Posted Image
Posted Image
Join Dashing today! http://www.dashing.co.nr


#12
ZekeDragon

ZekeDragon

    Writes binary right handed and hex left handed

  • Moderators
  • 2,103 posts
You have no idea what you're saying fantaonice. XD

C++ is hugely more complex than C ever dreamed of being. I can prove it: Templates.

You'll also need to become familiar with all the intricate ways objects interact with each other.

C is easy, and actually quite straightforward in comparison. I still love C++ though.
Wow I changed my sig!