Thread: char init question

  1. #1
    Registered User
    Join Date
    Feb 2016
    Posts
    6

    char init question

    hello, i have this function which search a word in **tablou.
    *x = pointer ;
    what is **tablou ?i've never seen this. thank you

    Code:
    int eqcuv(char *cuv, char **tablou) {
    	int size_word = str_length(cuv), i;
    
    
    	while (*tablou) {
    		if (*tablou == cuv) {
    			return 1;
    		}
    		++(tablou);
    	}
    	return 0;
    }

  2. #2
    Registered User
    Join Date
    Jun 2015
    Posts
    1,640
    I've translated your program into a language that nobody understands so we're all on an equal footing. Of course you could have presumably translated it into english, but why bother?
    Code:
    int wakawaka(char *sploodle, char **gorg) {
      int zzzz = str_length(splooge), x;
      while (*gorg) {
        if (*gorg == splooge)
          return 1;
        ++gorg;
      }
      return 0;
    }
    There, now that simplifies things!

    So sploodle appears to be some sort of string (we don't know if it's a standard C-style string since str_length is not standard).

    gorg is therefore presumably an array of strings. The addresses of these strings are then compared to the address of sploodle (this may be an error, since strings are usually compared char by char with a function like strcmp).

    I don't know why zzzz is calculated but not used or what's up with x.

  3. #3
    Registered User
    Join Date
    Feb 2016
    Posts
    6
    thank you

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. pthread question how would I init this data structure?
    By mr_coffee in forum C Programming
    Replies: 2
    Last Post: 02-23-2009, 12:42 PM
  2. Init-declarator?
    By Argyle in forum C++ Programming
    Replies: 3
    Last Post: 07-03-2007, 09:29 PM
  3. Newb Question - Cant convert Char[41] to Char
    By Kalkran in forum C++ Programming
    Replies: 2
    Last Post: 08-19-2004, 10:05 AM
  4. how to init 2d array ?
    By black in forum C# Programming
    Replies: 16
    Last Post: 04-25-2004, 04:33 PM
  5. Read File To Char Array with Null char init
    By MicroFiend in forum Windows Programming
    Replies: 1
    Last Post: 10-28-2003, 06:18 PM