| View previous topic :: View next topic |
| Author |
Message |
paupav Master Cheater
Reputation: 13
Joined: 15 Apr 2011 Posts: 314 Location: P. Sherman 42, Wallaby Way, Sydney
|
Posted: Thu Jul 11, 2013 1:52 pm Post subject: what am I doing wrong? |
|
|
also I've started to program again.
| Description: |
|
| Filesize: |
122.57 KB |
| Viewed: |
1894 Time(s) |

|
|
|
| Back to top |
|
 |
Innovation Grandmaster Cheater
Reputation: 12
Joined: 14 Aug 2008 Posts: 617
|
Posted: Thu Jul 11, 2013 2:21 pm Post subject: |
|
|
| Enclose "return a/b;" in curly braces. And there's nothing in the string to use the [] operator on.
|
|
| Back to top |
|
 |
NooksCranny Master Cheater
Reputation: -1
Joined: 28 Nov 2008 Posts: 373 Location: Occupation.
|
Posted: Thu Jul 11, 2013 4:01 pm Post subject: |
|
|
| Boi why you trying to use symbol as an array when it's declared as a string?
|
|
| Back to top |
|
 |
Innovation Grandmaster Cheater
Reputation: 12
Joined: 14 Aug 2008 Posts: 617
|
Posted: Thu Jul 11, 2013 5:25 pm Post subject: |
|
|
| NooksCranny wrote: | | Boi why you trying to use symbol as an array when it's declared as a string? |
A string is an array of characters.
|
|
| Back to top |
|
 |
gogodr I post too much
Reputation: 125
Joined: 19 Dec 2006 Posts: 2041
|
Posted: Thu Jul 11, 2013 7:49 pm Post subject: |
|
|
Google:
error: named return values are no longer supported
result: stack overflow.
someone with a similar problem
answer :
| Code: | float divide(float a, float b){
return a/b;
} |
also, you will get a null pointer exception on that switch. you gotta initialize your variables.
|
|
| Back to top |
|
 |
Innovation Grandmaster Cheater
Reputation: 12
Joined: 14 Aug 2008 Posts: 617
|
Posted: Thu Jul 11, 2013 8:42 pm Post subject: |
|
|
| gogodr wrote: | | also, you will get a null pointer exception on that switch. you gotta initialize your variables. |
Note that this is C++. There is no "null pointer exception," and you can do "functional style" initialization.
|
|
| Back to top |
|
 |
gogodr I post too much
Reputation: 125
Joined: 19 Dec 2006 Posts: 2041
|
Posted: Thu Jul 11, 2013 10:39 pm Post subject: |
|
|
| Innovation wrote: | | gogodr wrote: | | also, you will get a null pointer exception on that switch. you gotta initialize your variables. |
Note that this is C++. There is no "null pointer exception," and you can do "functional style" initialization. |
ok excuse me, it will crash then.
anyways, he PMed me with the whole thing and I fixed it for him. I hope he writes me back asking how and why
|
|
| Back to top |
|
 |
InternetIsSeriousBusiness Grandmaster Cheater Supreme
Reputation: 8
Joined: 12 Jul 2010 Posts: 1268
|
Posted: Thu Jul 11, 2013 11:40 pm Post subject: |
|
|
| Paupav is a faggit
|
|
| Back to top |
|
 |
|