LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-30-2008, 11:59 PM   #1
gvp87
Member
 
Registered: Mar 2007
Location: Boston
Distribution: Ubuntu Gutsy
Posts: 50

Rep: Reputation: 15
graphic function with memset()


I'm trying to write a graphic function with memset in c++, but i can't get the memset function to compile. I keep getting the message "can't convert from int to void*"

void screenSet(int color) { //int color is a number between 0 and 255
int screen = 0xa000;
memset(screen, color, 0xffff);//0xffff = 64000
}

I'm trying to fill the screen with a certain color, but can't get past the first argument of memset().

Can anyone tell me what I'm doing wrong and how I could get the results that I'm looking for??

any tips in the right direction would be great! thanks


giuseppe
 
Old 01-31-2008, 12:04 AM   #2
gvp87
Member
 
Registered: Mar 2007
Location: Boston
Distribution: Ubuntu Gutsy
Posts: 50

Original Poster
Rep: Reputation: 15
omg i just figured out what I was doing wrong.

char *screen = 0xa000;

should really have been:

char screen[0xa000];


thanks for reading my post anyways!!! :-D
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
warning: passing argument 2 of ‘memset’ makes integer from pointer without a cast nasim751 Programming 3 01-30-2008 09:16 AM
Graphic Driver: How to set up Livna graphic support? Chuong Linux - Software 11 08-20-2006 01:15 AM
memset vs char arr initialization syseeker Programming 4 03-29-2006 09:01 AM
Perl exec function in linux (and system-function) nazula Programming 1 04-19-2004 12:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration