Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pass string value into function as an array in c++
#1
Then I have these 3 functions:
C++ Syntax (Toggle Plain Text)

Code:
1. void getCatArrAndVals (char* arg[]) 2. { 3. //do something 4. } 5. 6. char * LoadCategory() 7. { 8. srand( time(NULL) ); 9. int RandIndex = rand() % 3; 10. theCategory=arrCats[RandIndex]; //category I'm interested in 11. getCatArrAndVals(colors); //I'm passing the hard-coded value of "colors" array 12. //here but I really want to pass theCategory 13. return theCategory; 14. } 15. 16. void AppMain() 17. { 18. LoadCategory();

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  why we use inline function if there are simple function available, or what is the spa Vuhelper 0 21,987 05-31-2012, 01:51 AM
Last Post: Vuhelper
  Default Function Argument with example Vuhelper 0 13,342 05-31-2012, 01:47 AM
Last Post: Vuhelper
  What is the difference among calloc function ,malloc function and recalloc function? Vuhelper 0 34,601 05-31-2012, 01:46 AM
Last Post: Vuhelper
  What is Function Overloading in C++ Vuhelper 0 5,410 05-31-2012, 01:45 AM
Last Post: Vuhelper
  offline function in C++ Vuhelper 0 3,637 05-31-2012, 01:42 AM
Last Post: Vuhelper
  i take input from getchar(); function in program in C++ 2012 Vuhelper 0 3,001 05-31-2012, 01:40 AM
Last Post: Vuhelper
  how we used the 1-calloc Function 2- malloc Function 3- free () 4- realloc Function i Vuhelper 1 31,146 05-31-2012, 01:35 AM
Last Post: Vuhelper
  What are the function of IO ports in C++ Vuhelper 0 3,607 05-31-2012, 01:27 AM
Last Post: Vuhelper
  Argc(argument count) and argv(argument value) are used in main function Vuhelper 0 2,035 01-04-2012, 10:42 PM
Last Post: Vuhelper
  array project code c++ 2011 Vuhelper 0 1,280 12-10-2011, 06:32 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 2 Guest(s)