[dundee] Re: Programming in OpenGL

Lee Hughes toxicnaan at yahoo.co.uk
Thu Feb 21 21:39:46 GMT 2008


care to elaborate on that?




#include <memory.h>
#include <stdio.h>

void main( void )
{
   char buffer[] = "This is a test of the memset function";

   printf( "Before: %s\n", buffer );
   memset( buffer, '*', 4 );
   printf( "After:  %s\n", buffer );
}


 Output
 
Before: This is a test of the memset function
After:  **** is a test of the memset function





Nistur <nistur at googlemail.com> wrote: Actually, forget about that, turns out I was doing something stupid 
somewhere else :)

Nistur wrote:
> Hmmm, I've got a graphics programming module that I've kinda been 
> neglecting as we have to demonstrate it on Windoze machines and I can 
> never be bothered to boot 'doze...
> I have finally got motivated though and decided to make an environment 
> similar to what we have been given, which was using the Windows API... 
> Thankfully our lecturer based his framework on the NeHe tutorials, 
> which also have a Linux copy of their tutorials handy. The problem 
> comes in the slight differences between NeHe and what we have. The 
> problem I have at the moment is that the windows stuff we have has 
> this in it:
>    Image *Texture[1];        //Creates storage space for the texture 
> Width hieght info etc, and the data itself .
>    memset(Texture,0,sizeof(void *)*1);    //makes sure the pointer is 
> set to null.
> Image being a struct that was previously defined. I have looked this 
> up on google and the only thing that comes up is a string function, 
> which this doesn't appear to match. Anyone know what I'm talking 
> about? I sure as hell don't :) Kinda be interested if someone knows a 
> solution, I ran it once with memset commented and it worked fine :P 
> Then I tried to run it again and I got a segmentation fault (which I 
> tracked to the memset just to be sure, well actually the function call 
> after the memset where it tries to write to the struct...)
>
> ------------------------------------------
> http://nistur.chaosnet.org
>
>
------------------------------------------
http://nistur.chaosnet.org


_______________________________________________
dundee GNU/Linux Users Group mailing list
dundee at lists.lug.org.uk  http://dundee.lug.org.uk
https://mailman.lug.org.uk/mailman/listinfo/dundee
Chat on IRC, #tlug on dundee.lug.org.uk


       
---------------------------------
 Yahoo! Answers - Get better answers from someone who knows. Tryit now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.lug.org.uk/pipermail/dundee/attachments/20080221/6a98959f/attachment.html


More information about the dundee mailing list