I feel like a moron :( thatz what happens when ur coding 12 hours straight. Fml. Thanks guys.
Type: Posts; User: hex_dump
I feel like a moron :( thatz what happens when ur coding 12 hours straight. Fml. Thanks guys.
I can't seem to get access to private variables I declared in my class. i get the following errors
sqlModel.cxx: In function ‘bool createDummyDatabase()’:
sqlModel.cxx:12:4: error: ‘db’ was not...
is your arduino connected to external power supply? googled it and that was what I found so you may want to make sure of that.
You should probably decide first if you want to write C++ or C code, pick one then go with that. Then post in the correct forum and maybe someone will help you out, if it isn't homework. maybe.
Laserlight, that list you wrote down read like episodes of the Big Bang Theory. ;)
@MutantThe truth of the matter is, even the experts don't agree on what OOP is, and quite frankly even they...
thanks guys, loops like a still have a way to go with this.
yeah no worries :) any ideas why my init_container function isn't working? I thought you could declare and empty vector and it would expand dynamically as I push_back()
hmmm....yeah that would suck...much like the book I'm learning from C++ By Dissection: Ira Pohl: 9780201787337: Amazon.com: Books
don't buy it!
okay, how is that? if x = 0, then it will...
Sorry, i copied it straight from vim with the :set numbers on. I'll remember that next time
I need to sum the even indices in the containers, thus my own function. unless std::accumulate()...
Nice! thanks that explained it very well.
lol, thanks. I'll try to remember to use some of the new C++11 features. I've changed the code below...you should like the new brace initializer syntax :)...
here's my code
1 //sum all elements at v[2*i]
2 //test on ints and doubles
3
4 #include <iostream>
5 #include <vector>
6 #include <cstdlib>
7 #include <ctime>
8
9 using...
if you're program is crashing, it means you're trying to access memory you don't own. So you'll have to trace the program to see what is being assigned to the 'course' variable and when.
I'd also...
I'm not on windows so i can't compile this so, have you tried to compile this? If so please post the errors you're getting.
Maybe but there are two schools of thought when learning C++. Some think it's better to learn the C basics first and then introduce classes and the STL later, while other like to jump right into the...
This looks like homework to me so I'm assuming the OP isn't allowed to use the STL yet, or perhaps hasn't gotten into them.
couple things for me...and I'm sure other board members will mention.
if you have have line 11 where you already included the std namespace, there is no need to have the using directive for cout...
yeah thanks figured that out. long day.
riiight...int division results in an integer response with the remainder truncated. If the divisor was smaller than the numerator it would have given me an int, but that's not the case here....i see....
ahhh...yeah this is really stupid but why is my program outputting zero for the variable pop?
#include <iostream>
int main(void){
using namespace std;
//capture data
cout <<...
okay, so back to the original question then: I wasn't re-initializing the values to zero was I?
Not bad...i like what you did on lines 35 and 36...I'm assuming this is what checks to see if a...
hey, sorry I've been away for a little bit. I'm not sure exactly where I'm resetting the count of each number.
//p.345 ex1
//generates N numbers to a list<>
//finds num of occurances of values...
here is the new code. I'm really just getting used to the containers in the STL so please bear with me. Any comments would be appreciated as a have a little bit of semantic satiation right now :) ...
wow, that was retarded on my part. Thank you!
Okay thank you, I'll check that and repost.
Thanks again.
I have the following code
//p.345 ex1
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <list>
#include <map>
#define RND_RANGE 10000
#define TIMES (RND_RANGE)
thanks rcgldr. That's what i used to get it to compile and run. I thought maybe the same as you too however I wanted to find out if that was truly the case. Thanks again.