C :: Assignment Of Element Of 2D Character Array To 1D Character Array
Jul 4, 2014Can we do this :
Code:
char strings[][100]={"ABC","EFG","IJK","LKM"};
char temp[100];
temp=strings[1];
Can we do this :
Code:
char strings[][100]={"ABC","EFG","IJK","LKM"};
char temp[100];
temp=strings[1];
how can i compare an element of the char array and string with single chsracter also how to compare char array to cpp string
View 3 Replies View RelatedThe program should store a character array in reverse order then display the reversed array. I have also included in the code that will display the actual characters into the array as it loops through. So I know the characters are being stored, but why doesn't it display the entire string when I call it?
Code:
#include<stdio.h>
int main(){
char str[50];
char rev[50];
printf("Enter Desired Text: ");
scanf ("%[^
[Code] ....
Is it just my compiler?
I am currently having an issue with validating user input for a state abbreviation. I have an array where a list of abbreviations is stored to use as a comparison for whatever the user inputs. I have been able to get the list loaded properly but whenever i go to compare, it always comes back as true even if it isn't. Here is some relevant code:
static char stateTable[STATE_TABLE_SIZE][STATE_SIZE];
int main() {
char buffer[40], *testCustName[40], testState[5], testCode;
buffer[0] = '