Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Array Expanding Functions in Tier 2?

Author
Message
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 22nd Nov 2017 20:08
In visual Studio, slowly converting my project to C++ using the TGC's official youtube tutorial.

I've come across something they didn't quite cover. The tutorial shows how to create an array in C++ but some of my code uses array resizing. I feel like the array resizing is not an AppGameKit feature but a core C++ function, which is where just adding an agk:: prefix wouldn't really work.

I googled the help for C++ array resizing and came up with this:
https://msdn.microsoft.com/en-us/library/bb348051(v=vs.110).aspx?cs-save-lang=1&cs-lang=cpp#code-snippet-1



Only issue is that Visual Studio doesn't seem to recognize the "Array::" part like it does "agk::"
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net
Alex_Peres
AGK Master
14
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 22nd Nov 2017 20:13
You need to learn dynamic arrays.
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 22nd Nov 2017 20:17
Yeah, I figured it wouldn't be as simple. I don't suppose the agk:: include it's own array handling conversions does it?
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 22nd Nov 2017 20:53
This is a excellent resource for C++.

http://www.cplusplus.com/doc/tutorial/arrays/
The coffee is lovely dark and deep,and I have code to write before I sleep.
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 23rd Nov 2017 09:43
Yes, you can also use the STL (Standart Template Library)


For more information, see the same source that 'Stab in the Dark' mentioned.
std::vector
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 23rd Nov 2017 09:51
Ah, damn. Well I've already used: Stab in the Dark's link to learn about dynamic arrays. Seems pretty straight forward. I'm experiencing other issues now. If you could take a look at my current thread, I'd appreciate it. I've finished converting every piece of Basic code to C++, not a single Compile Error or Warning from Visual Studio. The window pops momentarily and some exception error comes up. This is all too new to me to figure it out on my own:
https://forum.thegamecreators.com/thread/220951
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net

Login to post a reply

Server time is: 2024-04-25 03:28:16
Your offset time is: 2024-04-25 03:28:16