I am trying to create an array of strings in C. If I use this code:
char (*a[2])[14]; a[0]="blah"; a[1]="hmm";
gcc gives me “warning: assignment from incompatible pointer type”. What is the correct way to do this?
edit: I am curious why this should give a compiler warning since if I do printf(a[1]);
, it correctly prints “hmm”.
Related Posts:
- “error: assignment to expression with array type error” when I assign a struct field (C)
- How to create an array of strings in C?
- Array type char[] is not assignable
- How do I create an array of strings in C?
- Getting “conflicting types for function” in C, why?
- Getting “conflicting types for function” in C, why?
- How do I create an array of strings in C?
- Return char[]/string from a function [duplicate]
- What does ** do in C language?
- In Java, how to append a string more efficiently?
- Return char[]/string from a function
- How to clear all the elements of array in C?
- Initialization from incompatible pointer type warning when assigning to a pointer
- How can I find the number of elements in an array?
- Parameter name omitted error?
- C char array initialization
- Difference between char *argv[] and char **argv for the second argument to main()
- Dynamic vs static array in c
- The difference between char * and char[] [duplicate]
- GCC: Array type has incomplete element type
- How do I check if a string contains a certain character?
- variably modified array at file scope in C
- How to convert an int to string in C?
- How to convert a string to integer in C?
- char *array and char array[]
- Java Error “Exception in thread “main” java.util.InputMismatchException” On an Array program
- How to convert a char array to a string?
- How to print elements in a vector c++
- What is the difference between char s[] and char *s?
- Are vectors passed to functions by value or by reference in C++
- How do I declare a 2d array in C++ using new?
- How to split a String by space
- Does JavaScript have a method like “range()” to generate a range within the supplied bounds?
- How do I properly compare strings in C?
- How to remove .html from URL?
- Does JavaScript have a method like “range()” to generate a range within the supplied bounds?
- How to convert an int to string in C?
- How to convert jsonString to JSONObject in Java
- Array of arrays (Python/NumPy)
- What does strcmp() exactly return in C?
- what does “>>>” mean in java?
- Calculating Standard Deviation & Variance in C++
- How to check if a string is a number?
- Javascript Uncaught TypeError: Cannot read property ‘0’ of undefined
- What is a list in Bash?
- How to convert integer to string in C?
- Convert array of strings into a string in Java
- How to print elements from array with javascript
- How do I remove an array item in TypeScript?
- Finding the length of a Character Array in C
- What does << mean in Ruby?
- How to print a char array in C through printf?
- How do I concatenate const/literal strings in C?
- Zero an array in C code
- Passing an array by reference in C?
- Excess elements in char array initializer error
- How to properly malloc for array of struct in C
- C++ array assign error: invalid array assignment
- Convert String to int array in java
- Bubble sort algorithm in MIPS
- Convert char array to a int number in C
- How to sort an array of objects in Java?
- Error: unsupported use of matrix or array for column indexing
- Iterate through a C array
- Using multiple variables in a for loop in Python
- Allocating string with malloc
- What is the difference between char array and char pointer in C?
- Dynamically allocated string array, then change it’s value?
- How to copy a char array in C?
- Simple way to check if a string contains another string in C?
- type any? has no subscript members
- Ruby array to string conversion
- struct has no member named
- java.lang.ArrayIndexOutOfBoundsException: 4 Error
- IndexError: index 10 is out of bounds for axis 0 with size 10
- Initializing array of structures
- What is the difference between array and enum in C ?
- Double pointer array in c++
- Can I create an Array of Char pointers in C?
- Excess elements of scalar initializer for pointer to array of ints
- How to sort an array in Bash
- How to convert UTF-8 byte[] to string
- Two-dimensional array in Swift
- Trim a string in C [duplicate]
- How to remove first character from C-string?
- How to concatenate string and int in C?
- Tokenizing strings in C
- Standard function to replace character or substring in a char array?
- char array not assignable
- Warning: comparison of distinct pointer types
- Array to Hash Ruby
- How to format strings using printf() to get equal length in the output
- Java says this method has a constructor name
- C: warning: excess elements in array initializer; near initialization for ‘xxx’ ; expects ‘char *’, but has type ‘int’
- Split string with multiple delimiters using strtok in C
- Initializing 2D char array in C
- Remove empty array elements
- Numpy matrix to array
- Convert Char to String in C
- Using the Pythagorean theorem with Java