Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Nov 9th, 2005, 1:06 PM   #1
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 313
Rep Power: 4 Klarre is on a distinguished road
[x86] Arrays to functions

How do I call a function with an array as argument?
I have been written this code, but it does'nt work of course...
#include <iostream>

void printArray(float m[])
{
	std::cout << m[0] << std::endl;
	std::cout << m[1] << std::endl;
	std::cout << m[2] << std::endl;
}

int main()
{
	float m1 = 3, m2 = 2, m3 = 9;

	_asm
	{
		push m3 ; How should I prepare the floats?
		push m2
		push m1
		call printArray
	}

	system("pause");
	return 0;
}

/Klarre
Klarre is online now   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:17 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC