By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,824 Members | 2,337 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,824 IT Pros & Developers. It's quick & easy.

How to initialize const char **str

P: n/a
For an API of software named Teamcenter I need to pass arguments to function in following format.

function(const char **str1, const char ** str2)

So, I have to initialize const char **str.
Nov 16 '10 #1
Share this Question
Share on Google+
2 Replies

Expert 5K+
P: 6,050
It expects a pointer to a character array.

Expand|Select|Wrap|Line Numbers
  1. char *str1 = "String 1";
  2. char *str2 = "String 2";
  4. /* expects a point to a character pointer */
  5. some_function (&str1, &str2);
Nov 16 '10 #2

P: 687
It may as well expect something like this
Expand|Select|Wrap|Line Numbers
  1. char *a="abcd"; char*b = "dcba";
  2. char *s[2] = {a,b};
  3. some_function(s);
Nov 16 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.