Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

A few C++ questions

Name: Anonymous 2006-06-17 4:08

I learned in a different language, so I need to ask these.

1) Arrays
If you pass an array as a method parameter, do you pass pointers to data (so any changes made to the array in the method affect the array without having to return any values) or actual data?

2) Arrays & methods again
When declaring a method you want to recieve an array as a parameter for, do you need to declare Method(int array[##]) or just Method(int array)?

3) Strings
There are no string-variables in C++, only arrays of characters?  Again, I learned in a different language.

Name: Anonymous 2006-06-17 6:29

>>1
1) You don't (but you can), you pass pointers to the array.  Meaning that the data is the same inside the function and outside.

2) void meth(int * array) ;) Pass in array like meth(&array)

3) std::string. #include <string>.

Name: Anonymous 2006-06-17 7:56

>>2
strings are also in <iostream.h>

Name: Anonymous 2006-06-17 14:23 (sage)

>>3
<iostream.h> is a deprecated header. Best include both <iostream> and <string>, suck up the namespace ugliness and learn to grin.

Name: Anonymous 2006-06-19 1:54

is there another version of math.h that isn't deprecated?  because it seems to be giving me problems...

Name: Anonymous 2006-06-19 1:58

#include <cmath>

Name: Anonymous 2006-06-19 2:58 (sage)

>>4
ok

Name: Anonymous 2007-09-23 16:47 ID:Heaven

EXPERT PROGRAMMERS

Name: Anonymous 2010-06-07 6:42

Hi, I can spam /prog/ too, you faggot.

Also, smoke weed everyday.

Name: Anonymous 2010-12-24 7:50

Name: Anonymous 2011-01-26 15:46

test
test

Name: Anonymous 2011-02-04 12:55

Name: Anonymous 2011-02-26 7:41

               _..-――-- ..._
       .. -―''" ̄::::::: :::: ::::: ::: ::::::: :ヽ..
     / ... ... .:::::..:::::.::::|:: ::: :::: :: ::: ::: ::: :: ``\
    /. .. .. .. :....::....::::.:::.:::|::::::::::::.:::.:::.:.::: :: :: : :: :: :ヽ
   /.. . /. .......:::.::::.:::.:::::::::::|::::::::::.:::::ヽ:::.:::::.::::.:.:: ::: : :::ハ
.  /.〃/.:.:./:.::::.:::::::;::::|::::.:/|::::.:::::::.|  \:::.::::.::::: : :: : ::::|
.  |/ /.:.:.:.:|::.:.:.:.:.::/:::丨:/ |::.::: ::::|   `_::::::::::: : : :: |
.   ,'.: .:::.:.|:.::::::.:::厂 ̄丁` |:::.::::.::|   ̄ \ ̄::|:: : :: ::|
  |.::::::::.|::.::::::::|:  二   \::.:::|   _  \::|::: :: :: |
   |..:.::::::ハ.::::::.:|/ f:::::`ト   \| 彳 ̄.`ド ::.:|:: ::::: :|
  |  ∧:::\:::|ヾ〈:: ..::::|       |::.. ...:::| |::::.!:::::::::八
.   | ./ ヽ|::.::`:  ヽ辷ノ      弋:::::..:ノ..|::::::::.::.:/:「
   ∨   .|::.:::::::|       .      ̄  ,|::.:.:::::/:、|
          |::.::::八         _      /::.:::/
        |ト、::::::::>- ..__         _..〃:/     
.         ∥ \::::   ,r=ァ― T<´ //   
            ̄./:::::::丿  Ц:::\    
           /.... . ...├―─‐┤: :::\ 
          /:ヽ. . . . . .レ'':⌒`ヽ|: : : : : :>、
            /\::ヽ. . . . レ''⌒`ヽ1: : : : :/::/ヽ
        /:::\\::\. .|. . . . . . ノ: : : :./::/ /::ヽ

Name: Anonymous 2011-02-26 7:41

               _..-――-- ..._
       .. -―''" ̄::::::: :::: ::::: ::: ::::::: :ヽ..
     / ... ... .:::::..:::::.::::|:: ::: :::: :: ::: ::: ::: :: ``\
    /. .. .. .. :....::....::::.:::.:::|::::::::::::.:::.:::.:.::: :: :: : :: :: :ヽ
   /.. . /. .......:::.::::.:::.:::::::::::|::::::::::.:::::ヽ:::.:::::.::::.:.:: ::: : :::ハ
.  /.〃/.:.:./:.::::.:::::::;::::|::::.:/|::::.:::::::.|  \:::.::::.::::: : :: : ::::|
.  |/ /.:.:.:.:|::.:.:.:.:.::/:::丨:/ |::.::: ::::|   `_::::::::::: : : :: |
.   ,'.: .:::.:.|:.::::::.:::厂 ̄丁` |:::.::::.::|   ̄ \ ̄::|:: : :: ::|
  |.::::::::.|::.::::::::|:  二   \::.:::|   _  \::|::: :: :: |
   |..:.::::::ハ.::::::.:|/ f:::::`ト   \| 彳 ̄.`ド ::.:|:: ::::: :|
  |  ∧:::\:::|ヾ〈:: ..::::|       |::.. ...:::| |::::.!:::::::::八
.   | ./ ヽ|::.::`:  ヽ辷ノ      弋:::::..:ノ..|::::::::.::.:/:「
   ∨   .|::.:::::::|       .      ̄  ,|::.:.:::::/:、|
          |::.::::八         _      /::.:::/
        |ト、::::::::>- ..__         _..〃:/     
.         ∥ \::::   ,r=ァ― T<´ //   
            ̄./:::::::丿  Ц:::\    
           /.... . ...├―─‐┤: :::\ 
          /:ヽ. . . . . .レ'':⌒`ヽ|: : : : : :>、
            /\::ヽ. . . . レ''⌒`ヽ1: : : : :/::/ヽ
        /:::\\::\. .|. . . . . . ノ: : : :./::/ /::ヽ

Name: Sgt.Kabu꫓䓭kiman⣪ 2012-05-28 19:28

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List