| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12
Comments:
<0> uX use std::vector<BYTE> instead of that <1> vawjrwrk might there be a win98 version of the visual c++? <2> someone in NYC inhaled anthrax...the sky is falling! time to invade a country <0> alohaarts no <3> 6.0 <3> 98 is almost 10 years old <3> so you'll have to find something nearly 10 years old <0> oh geez, he's trying to leanr the language, peterhu <3> heh <4> mabaa: I can't wait till the next opportunity. <3> well, he picked the wrong platform, that's for suer <3> sure <5> vawjrwrk, thats not an option <3> i suggest linux or windows xp <0> uX why not? <5> compilator does not take templates
<0> what compiler are you using? it's clearly NOT a C++ compiler <5> it is <0> they lie <5> samee than yesterday i talked about, IAR something <5> to put on a PIC <0> yeah, they lie <0> like a rug <0> it's one reason we refused to use their chips in anything <1> oki then.. notepad is good? :) <3> you could learn vim =) <5> well, still... is there a way to get amount of bytes allocated with a new? <3> vim runs fine on 9x <3> and pretty much all platforms <0> uX not that I know of <3> i'm sure there has to be a decent IDE that works on 9x out there <0> and even if I did, your "supposed compiiler" probably wouldn't ocmpile it anyway <3> but as i haven't used 9x in almost 10 years, i'm not the one to talk to <4> uX: char* p = new char[5]; <0> dev-cpp does, peter <5> Run, and how do i get the size? <3> i dumped 9x as soon as i got quake running on NT4 =) <4> The size is 5 <5> i know i can hardcode the 5 everywhere, but is there an other option <5> like programmatically get the number of bytes <5> like a sizeof, but at compile time <5> runtime <4> Use a vector<char> is you want dynamic sizes, otherwise the size is static and you can use some const: int const my_size = 5; char* p = new char[my_size]; <4> If you want it at compile time, actually - you don't need new. <5> as i said earlier, thats not an option <4> What's wrong with: <4> char p[my_size]; <4> ? <6> sizeof returns the total size of arrays... Does it do so only for static-sized array, or does it do so for new'ed, dynamic-sized arrays too? <4> DrkMatter: sizeof returns the size of the type - which cannot be dynamic <7> yeah, sizeof is a compile time thing <5> i need to dynamically allocate and i cannot use templates of any sort <7> why can't you use templates? that's idiotic <5> i could probably do a bunch of defines, but i dont want to get in that <7> does your compiler not support templates? <5> if there is no other option, ill do that <0> he doesn't have a standard C++ compiler <5> it does not <7> hmm, what platform? <5> even if it would, it would take WAY too much memory <7> what would - templates? <5> i just wwanna create BYTE[3] or 4 or 5 <4> uX: Then write your own vector<char> cl***, without templates. <5> why would i use a vector for that <5> takes more memory <0> because you're calling new <4> cl*** CharArray; or something ... <4> cl*** String; perhaps <7> because vectors model a dynamic array - that's what they're for <5> memory is really the big factor here <5> if i need 2 bytes, i dont want to hold it in 10 <7> so? vector's don't take up much memory <5> how much meory would the cl*** take + functions and things <0> so you're going to hold it in 2 and sizeof(BYTE*) <4> uX: What about alignment? <4> If you have to look on single bytes, you shouldn't use C++ <8> uX: functions are not data, they don't take memory
<7> sure they do <5> ??? <4> They do as program code <8> in which way? <4> C++ program code will be pretty damn large compared to say ***embly code. <7> it depends on the platform I guess <7> what platform is this for? <4> at least 100k imho <8> so , if you've got 100 instances, that doesn't mean you've got 100 identical member functions <5> dsPIC <7> melfar that's not what you said <7> you said "functions don't take memory" <5> i have 2Ko for stack/heap + 2ko for code or something <5> im not sure about values, but its 4Ko total <8> okay he asked how much mem would the functions take and I answered <4> What is Ko ? <7> knockout! <5> Kb <5> sorry.. french ;) <0> octet? <8> member functions doesn't differ from global functions in that way <4> You have 2 kb for code? <8> don't <5> yup <5> octet = bytes <3> (non-virtual) <4> I suggest you start coding in ***embly <7> 2k? good lord <5> no cuz later on, we'll have some more memory added <7> what kind of software do you have to write? <4> *shrug* <4> I suppose this is being uploaded to the mars lander? <5> a handheld to control a variable messages sign <5> like the ones you see on the side of roads <5> wireless handheld <5> lol <0> what wireless method you using? <4> uX: still <4> 2 kb is nothing <4> you can't even get a hello world in it <5> it's xbee or something <7> you can <0> zigbee? very nice <5> like hardware bluetooth, i dont do hardware, just soft <0> that's what we used w/ the AVR chips <4> He doesn't have a libc apparently. <5> yes zigbee, must be that <5> we have nothing, we develop our kinda motherboard <8> "hello world" is a syscall write on linux which is I suppose no more than 50 bytes <4> uX: did you write your own malloc library? <5> with that dsPIC <0> yup, been there <9> borland 5 rulez! <7> if you have a good C compiler, I guess i'd use that over the bad C++ compiler <5> my teammate did <4> uX: isn't that libraries code also loaded in that same 2kb? <5> he wrote filesystem and stuff which well put in next version <5> yes <4> Well, then I think you should directly call that malloc/free <8> a simple cl*** doing just the same isn't any more memory consuming <10> folks, what is a good regex library for C++? I want to validata custom masks, like say "nnn.nnn.nnn.nnn" for an IP address <5> hmmm, sorry i misunderstood your question, he wrote memset, memcpy and stuff, but no malloc for now <0> boost <7> mozai - boost has one <4> You will have to 'remember' the size you allocated in a smart way - it seems a waste of memory to store size of the allocated memory in every allocated object. <10> great <10> ok thanks <4> uX: does that mean you don't have a heap? <7> just write a simple memory allocator <4> You need to get everything from the stack? <4> memory allocators eat memory :/ <7> yeah I guess it doesn't have to be that flexible <4> I mean... I come from a time where we had 2 kb (finally my paranoia about memory usage is useful again heh)
Return to
#c++ or Go to some related
logs:
nahxik #linux #chatzone c++ coprime
#MissKitten #linux netbeans haqq is-suwed #MissKitten Regular Expression.pdf
|
|