Click here to Skip to main content
15,908,776 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Preprocessor Directive Pin
Niklas L1-Feb-11 1:50
Niklas L1-Feb-11 1:50 
GeneralRe: Preprocessor Directive Pin
Niklas L1-Feb-11 1:41
Niklas L1-Feb-11 1:41 
GeneralRe: Preprocessor Directive Pin
Stefan_Lang1-Feb-11 0:11
Stefan_Lang1-Feb-11 0:11 
AnswerRe: Preprocessor Directive Pin
Malli_S31-Jan-11 21:10
Malli_S31-Jan-11 21:10 
QuestionMFC - Printing - Changing page orientation from a custom pagesetup dialog [SOLVED] Pin
Un Suthee31-Jan-11 15:11
Un Suthee31-Jan-11 15:11 
AnswerRe: MFC - Printing - Changing page orientation from a custom pagesetup dialog Pin
Roger Allen2-Feb-11 5:46
Roger Allen2-Feb-11 5:46 
GeneralRe: MFC - Printing - Changing page orientation from a custom pagesetup dialog Pin
Un Suthee3-Feb-11 16:30
Un Suthee3-Feb-11 16:30 
Question2D dynamic wchar array Pin
csrss31-Jan-11 13:30
csrss31-Jan-11 13:30 
I just cant get this, how would you, for example, return, lets say, a (database) table from a function?
In C (no c++ stuff). For example, we got a table like:
row one
row two
2 rows with 2 columns, 2x2:

wchar_t *array[2][2]
{
    {L"row", L"one"},
    {L"row", L"two"}
};


But how to create things dynamically? And we dont know how many rows are there, nor how many columns.
How to allocate mem for this, and then do something like: (thats wrong and lame an i know it is pathetic)

array = malloc(initial size/* which is: 1 row and 1 column */)
getting_a_row, ok, it has 2 columns, allocating mem for 1 row and 2 columns
proceeding... we got next row! so now we got 2 rows and 2 columns, allocating mem for next row with 2 columns

and then something even more lame:

wcscpy(rows[0][0], L"row"); wcscpy(rows[0][1], L"one");
wcscpy(rows[1][0], L"row"); wcscpy(rows[1][1], L"two");


thanks
011011010110000101100011011010000110100101101110
0110010101110011

AnswerRe: 2D dynamic wchar array Pin
Andrew Brock31-Jan-11 16:41
Andrew Brock31-Jan-11 16:41 
GeneralRe: 2D dynamic wchar array Pin
csrss31-Jan-11 22:35
csrss31-Jan-11 22:35 
AnswerRe: 2D dynamic wchar array [DONE] Pin
csrss1-Feb-11 2:25
csrss1-Feb-11 2:25 
AnswerRe: 2D dynamic wchar array [modified] Pin
Emilio Garavaglia31-Jan-11 20:50
Emilio Garavaglia31-Jan-11 20:50 
GeneralRe: 2D dynamic wchar array Pin
csrss31-Jan-11 22:45
csrss31-Jan-11 22:45 
QuestionString array comparison Pin
jharn31-Jan-11 4:48
jharn31-Jan-11 4:48 
QuestionRe: String array comparison Pin
David Crow31-Jan-11 4:57
David Crow31-Jan-11 4:57 
AnswerRe: String array comparison Pin
jharn31-Jan-11 5:08
jharn31-Jan-11 5:08 
AnswerRe: String array comparison Pin
David Crow31-Jan-11 5:41
David Crow31-Jan-11 5:41 
GeneralRe: String array comparison Pin
jharn31-Jan-11 6:09
jharn31-Jan-11 6:09 
GeneralRe: String array comparison Pin
Matthew Barnett1-Feb-11 1:06
Matthew Barnett1-Feb-11 1:06 
AnswerRe: String array comparison Pin
jharn31-Jan-11 5:46
jharn31-Jan-11 5:46 
AnswerRe: String array comparison Pin
David Crow31-Jan-11 6:08
David Crow31-Jan-11 6:08 
GeneralRe: String array comparison Pin
jharn31-Jan-11 6:10
jharn31-Jan-11 6:10 
GeneralRe: String array comparison Pin
jharn31-Jan-11 9:03
jharn31-Jan-11 9:03 
GeneralRe: String array comparison Pin
jsc421-Feb-11 0:13
professionaljsc421-Feb-11 0:13 
QuestionRe: String array comparison Pin
David Crow1-Feb-11 8:51
David Crow1-Feb-11 8:51 

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.