Click here to Skip to main content
15,912,932 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generala dynamic-link library for 3D GameStudio Pin
BeyelerStudios2-Nov-04 9:47
BeyelerStudios2-Nov-04 9:47 
GeneralAbout scrollbars Pin
n_a12-Nov-04 8:43
n_a12-Nov-04 8:43 
GeneralRe: About scrollbars Pin
n_a12-Nov-04 23:14
n_a12-Nov-04 23:14 
GeneralHelp me speed this up! Pin
Nitron2-Nov-04 8:36
Nitron2-Nov-04 8:36 
GeneralRe: Help me speed this up! Pin
Joaquín M López Muñoz2-Nov-04 9:13
Joaquín M López Muñoz2-Nov-04 9:13 
GeneralRe: Help me speed this up! Pin
Nitron2-Nov-04 9:21
Nitron2-Nov-04 9:21 
QuestionHow to Declare program, Menu and Dialog Pin
Dody_DK2-Nov-04 8:32
Dody_DK2-Nov-04 8:32 
GeneralRe: func to create 2-d array in C Pin
Joaquín M López Muñoz2-Nov-04 8:26
Joaquín M López Muñoz2-Nov-04 8:26 
You are having troubles with pass-by-value semantics. Consider the following:
void foo(int var)
{
  var=1;
}

...

int x=0;
foo(x);
// what's the value of x?
The value of x after calling foo(x) will still be 0, as you're passing a copy of x to foo (i.e. its value) and not the real variable. C++ has so called references to allow you to pass a variable rather than a value:
void foo(int& var)
{
  var=1;
}

...

int x=0;
foo(x);
// OK, x will be 1 now
The only difference is the & in the declaration of foo. Use the same technique in your code. If this is your first exposure to references, I suggest you learn more about them in some C++ book or online reference. Hope this helps.


Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
GeneralRe: func to create 2-d array in C Pin
Budric B.2-Nov-04 8:34
Budric B.2-Nov-04 8:34 
GeneralRe: func to create 2-d array in C Pin
act_x2-Nov-04 8:40
act_x2-Nov-04 8:40 
Generalfunc to create 2-d array in C Pin
act_x2-Nov-04 8:13
act_x2-Nov-04 8:13 
General"cout" and "cin" won't work Pin
Verolix2-Nov-04 7:25
Verolix2-Nov-04 7:25 
GeneralRe: "cout" and "cin" won't work Pin
Joaquín M López Muñoz2-Nov-04 8:19
Joaquín M López Muñoz2-Nov-04 8:19 
GeneralRe: "cout" and "cin" won't work Pin
Verolix2-Nov-04 9:59
Verolix2-Nov-04 9:59 
GeneralRe: "cout" and "cin" won't work Pin
Joaquín M López Muñoz2-Nov-04 10:07
Joaquín M López Muñoz2-Nov-04 10:07 
GeneralRe: "cout" and "cin" won't work Pin
Verolix2-Nov-04 10:15
Verolix2-Nov-04 10:15 
GeneralMoving Horz ScrollBar Pin
manosza2-Nov-04 6:52
manosza2-Nov-04 6:52 
Generalpreferences in registry Pin
ehh2-Nov-04 6:37
ehh2-Nov-04 6:37 
GeneralRe: preferences in registry Pin
BlackDice2-Nov-04 6:46
BlackDice2-Nov-04 6:46 
GeneralRe: preferences in registry Pin
David Crow2-Nov-04 6:56
David Crow2-Nov-04 6:56 
GeneralRe: preferences in registry Pin
Blake Miller2-Nov-04 7:46
Blake Miller2-Nov-04 7:46 
GeneralRe: preferences in registry Pin
ehh3-Nov-04 6:47
ehh3-Nov-04 6:47 
GeneralSchool projects Pin
Izaquad2-Nov-04 6:29
Izaquad2-Nov-04 6:29 
GeneralRe: School projects Pin
David Crow2-Nov-04 6:57
David Crow2-Nov-04 6:57 
GeneralRe: School projects here is my code Pin
Izaquad2-Nov-04 7:32
Izaquad2-Nov-04 7:32 

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.