In your opinion, when creating a nested loop is it best to use the call function and if so is using a pointer the route to go when creating the function?

In your opinion, when creating a nested loop is it best to use the call function and if so is using a pointer the route to go when creating the function?

That's like asking when ordering a hamburger is it better to drive a Mustang?

The things in your question don't have a direct relationship.

Comments
yeah, i lol'd
Sometimes that makes a difference. It depnds on how high-end the place is

I'm trying to create a dice game and don’t know if I should call the function or have it all in the main function and if I do have to call it I was curious if pointers are necessary when using strings

Edited 6 Years Ago by mr.confused!: n/a

If your code is huge then break it into functions
If you have to pass some parameters to the functions, passing them by pointers has an advantage that you can manipulate the value of the string inside the function

Does this answer your question ?If not phrase it differently. As of now its not making any sense at all

Comments
not a smart ass!

Whenever possible, try to avoid nested loop as they have a worst-case of O(n2) - Big O n square. In simple terms, it has bad processing time because your worst case for nested loop is n square iterations. When your n is sufficiently large, your logic will take a very long time to run.

Whenever possible, try to avoid nested loop as they have a worst-case of O(n2) - Big O n square.

the criticism you give is meaningful only for extremely large loops or realtime embedded applications such as scientific instrumentation and measurement.

for small to average sized loops -- the vast majority of cases in a help forum -- the time hit is inconsequential, and nested loops are often the simplest and most direct solution.

He's playing a dice game, for the gods' sake. we don't need a junior-level CSC optimization lecture. :icon_rolleyes:

Edited 6 Years Ago by jephthah: n/a

Comments
I cried when I read this, even a little wee came out.
This article has been dead for over six months. Start a new discussion instead.