Questions of c++ codes being used

I saw this code on the net a while agao but i cant seems to understand why he
uses structs combos and strcpy
can anyone explain to me?
1
2
3
4
5
6
7
8
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <string.h>

using namespace  std;

s

Thanks!
Last edited on
Okay I didn't go through the entire code...

struct: organize a data in a container or wrapper.
combos: is a struct.
strcpy: copies a string (a combination of numbers/characters) into another.

Here, the "he" is listing all the correct combinations.
Oo okay but can u tell me why he use these?
Thx by the way
Any1???
Because that's what he decided to use when making the program.

He could have named his struct "dog" or "cat" but since this struct of data represents combonations he named it "combos"

Strcpy is a convience method that allows a programmer to copy array of chars into one another. Usually when you have a char name[20] You'd have to have a loop to loop through each character and copy it into another destination array.

Remember the data type of string is just a fancy char* with helper functions and overloaded operators.

http://www.cplusplus.com/reference/clibrary/cstring/strcpy/
Topic archived. No new replies allowed.