Click here to Skip to main content
16,014,294 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
QuestionDoing encryption that embedded into mail server Pin
xiaomahe2-Jan-09 7:49
xiaomahe2-Jan-09 7:49 
AnswerRe: Doing encryption that embedded into mail server Pin
JasonPSage27-Feb-09 12:51
JasonPSage27-Feb-09 12:51 
QuestionAccessing ping through c/c++ Pin
tassadaque31-Dec-08 2:18
tassadaque31-Dec-08 2:18 
AnswerRe: Accessing ping through c/c++ Pin
Cosmic Egg10-Jan-09 4:03
Cosmic Egg10-Jan-09 4:03 
QuestionC programming in Linux warning message Pin
Kogee San9-Dec-08 17:24
Kogee San9-Dec-08 17:24 
AnswerRe: C programming in Linux warning message Pin
L. Madhavan17-Dec-08 17:58
L. Madhavan17-Dec-08 17:58 
GeneralRe: C programming in Linux warning message Pin
Kogee San18-Dec-08 0:45
Kogee San18-Dec-08 0:45 
GeneralRe: C programming in Linux warning message Pin
L. Madhavan18-Dec-08 1:15
L. Madhavan18-Dec-08 1:15 
You're partially right about the *opt_socket_name[5] thing. You declare the array of pointers using a *, eg. char *opt_socket_name[5].

Now, for a normal pointer, you would assign it the address of an existing variable. Example:
int value = 10;
int *pointer = &value;
printf("%d\n", *pointer);

But the problem is that there is no string data type in C. A string itself is an array of characters and an array is internally a pointer, which means that a string is already a pointer. So the & and * are not used at all. This is how you would use an array of strings:
main() {
  int i;
  char *opt_socket_name[5];

  char string1[10];
  // ...
  char string5[10];

  strcpy(string1, "hello 1");
  // ...
  strcpy(string5, "hello 5");

  opt_socket_name[0] = string1;
  // ...
  opt_socket_name[4] = string5;

  for (i = 0; i < 5; i++)
    printf("%s\n", opt_socket_name[i]);
}

GeneralRe: C programming in Linux warning message Pin
Kogee San18-Dec-08 20:54
Kogee San18-Dec-08 20:54 
QuestionPHP editor? Pin
blackhattrick9-Dec-08 7:48
blackhattrick9-Dec-08 7:48 
AnswerRe: PHP editor? Pin
L. Madhavan16-Dec-08 23:00
L. Madhavan16-Dec-08 23:00 
AnswerRe: PHP editor? Pin
jeffb4228-Jan-09 8:54
jeffb4228-Jan-09 8:54 
AnswerRe: PHP editor? Pin
Jules VDV29-Jan-09 8:36
Jules VDV29-Jan-09 8:36 
AnswerRe: PHP editor? Pin
JimmyRopes31-Jan-09 15:20
professionalJimmyRopes31-Jan-09 15:20 
Questionbookmarks Pin
chiangkinghu8-Dec-08 21:10
chiangkinghu8-Dec-08 21:10 
AnswerRe: bookmarks Pin
Ranjit Viswakumar29-Jan-09 12:12
Ranjit Viswakumar29-Jan-09 12:12 
AnswerRe: bookmarks Pin
EliottA2-Feb-09 2:36
EliottA2-Feb-09 2:36 
Questionto upload video in php Pin
umeshdaiya5-Dec-08 18:03
umeshdaiya5-Dec-08 18:03 
AnswerRe: to upload video in php Pin
Mohammad Dayyan10-Dec-08 23:47
Mohammad Dayyan10-Dec-08 23:47 
Questionajax problem Pin
umeshdaiya28-Nov-08 1:00
umeshdaiya28-Nov-08 1:00 
AnswerRe: ajax problem Pin
Mohammad Dayyan28-Nov-08 10:08
Mohammad Dayyan28-Nov-08 10:08 
AnswerRe: ajax problem Pin
Ranjit Viswakumar29-Jan-09 12:20
Ranjit Viswakumar29-Jan-09 12:20 
QuestionLinux web proxy Pin
Mekong River27-Nov-08 17:16
Mekong River27-Nov-08 17:16 
AnswerRe: Linux web proxy Pin
L. Madhavan17-Dec-08 18:04
L. Madhavan17-Dec-08 18:04 
QuestionEncoding problem of use ftp with C# Pin
crushglass19-Nov-08 16:24
crushglass19-Nov-08 16:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.