Note that there are some explanatory texts on larger screens.

plurals
  1. POcopying matrixes in c
    primarykey
    data
    text
    <p>So I ve got this: char table1[10^length][length]; char table2[10^length][length];</p> <p>And compiler doesn't let me dot this: table1=table2;</p> <p>my code is supposed to take a string with wild caracters (only ?)</p> <p>and give all the possible strings in the output (well it is a part of a bigger project but lets say print them in terminal - if I do this I can handle the rest)</p> <p>Here is the full code:</p> <pre><code>int ** wildReplacement(char *wildAM,int length) { length=7; char * temp; strcpy(wildAM,"123?23"); //getchar(); int i=0; int j=0; int k=0; int l=0; int limit=0; int wildCharsNum; char *nlptr= NULL; char table1[10^length][length]; char table2[10^length][length]; wildCharsNum=charOccurenciesInStr(wildAM,'?'); strcpy(temp,wildAM); strcpy(table1[0],wildAM); printf("\n!!WildChars In wildAM:%d",wildCharsNum); while(k&lt;wildCharsNum) { l=0; while(l&lt;=limit) { strcpy(temp,table1[l]); i=0; nlptr = strchr(temp, '?');//ka8e fora vriskei to epomeno ? if (nlptr) { for(j=1;j&lt;10;j++) { *nlptr = myItoc(j);//antikatastasi tou ? me digits sto temp strcpy(table2[i],temp); i++; } } l++; } table1=table2; limit=i; k++; } printf("\nWild Numbers out:"); for(i=0;i&lt;limit;i++) { printf("\n%s",table1[i]); } } </code></pre> <p>Should I malloc like:</p> <pre><code>char ** table1 char ** table2 table1=malloc(sizeof(char)*10^length*lenght) table2=malloc(sizeof(char)*10^length*lenght) </code></pre> <p>How would the programm know when each record ends</p> <p>Then what would this mean: table1[1] ? probably nothing...</p> <p>Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload