- 0
[C] Change values of a struct within a function
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By excalpius · Posted
I suspect that this was also due to a nice juicy bribe from the Chinese. They know how to pay to play... -
By Steven P. · Posted
You can get RAID if it is connected to a TerraMaster NAS (TOS 6). In that case this device is interesting if you want to expand your existing TerraMaster NAS setup. For example you could get a cheap 2- or 4-bay HDD model (with at least USB 3.2 10Gbps port), and then add this for a low power storage expansion. -
By LoneWolfSL · Posted
Microsoft announces multi-year partnership with AMD for future of Xbox consoles and hardware by Pulasthi Ariyasinghe The Xbox Games Showcase was earlier this month with its own hardware announcement, but Microsoft had kept a major partnership under wraps for now. Today, it revealed that it has established a "strategic multi-year partnership with AMD" to develop its next-generation Xbox consoles and other devices. In a video uploaded to the Xbox social channels, Xbox president Sarah Bond announced the partnership with AMD. Remember that Microsoft's Xbox Series X|S consoles and the previous Xbox One lineup already tout AMD silicon inside, so the continued partnership isn't a big surprise. "Together with AMD we're advancing the state of art in gaming silicon to deliver the next generation of graphics innovation to unlock a deeper level of visual quality and immersive gameplay and player experiences enhanced with the power of AI, all while maintaining compatibility with your existing library of Xbox games," said Bond in the video promoting the partnership. The two Xbox Ally Windows gaming handhelds that were announced earlier this month also come with AMD internals, offering handheld gaming experiences with a unique, lightweight version of bloat-free Windows 11. What was also interesting were the few hints that were dropped today regarding the focus of the Xbox brand going forward. "This is all about building you a gaming platform that's always with you, so you can play the games you want across devices anywhere you want, delivering you an Xbox experience not locked to a single store or tied to one device," added Bond. It was also confirmed that the next generation of Xbox devices will continue to offer backward compatibility, letting players keep their existing libraries when moving forward. Finishing off the video, Bond confirmed that the Xbox team is now working on Windows to make it the "number one platform for gaming," perhaps alluding to moving away from being focused on home consoles. -
By excalpius · Posted
Kudos to the happy talented people who created that happy trailer. PS It's gorgeous! -
By Draidus12 · Posted
Maybe the site will get out of dabbing into Identity Politics.
-
-
Recent Achievements
-
Cole Multipass earned a badge
Reacting Well
-
JLP earned a badge
Reacting Well
-
Rhydderch earned a badge
Week One Done
-
dismuter went up a rank
Experienced
-
mevinyavin earned a badge
One Month Later
-
-
Popular Contributors
-
Tell a friend
Question
~Matt~
Hey guys, the snippet of code below is the definition of a struct called "Game" as well as a function that has been initialised, called "Game throwdice" for my uni project. I have two questions what does the struct function type do? Also I want to be able to update the values in the struct from within the function. I am not allowed to change the definition of the Game throwdice function to use pointers. How would I go about changing the values of the struct? My attempt at making this work is in the second code snippet:
My attempt at implementing this function:
Game throwDice (Game g, int diceScore){
g.diceScore=diceScore; //update the diceScore in the struct
g.currentTurn++; //advance the game to the next turn
return g;
}
[/CODE]
Link to comment
https://www.neowin.net/forum/topic/1073715-c-change-values-of-a-struct-within-a-function/Share on other sites
18 answers to this question
Recommended Posts