17 Solved Topics

Remove Filter
Member Avatar for NathanOliver

Hey Daniweb, I have recently started working with threads in the c++11 library. I started with a simple dispatch mechanism where I have a queue and that would get passed to the threads and the threads would take turns emptying the queue. Since each thread needs to share the queue …

Member Avatar for NathanOliver
0
338
Member Avatar for NathanOliver

I was reading some articles on cplusplus.com and for kicks I read the template tutorial. At the very end of the section there is this paragraph: Since no code is generated until a template is instantiated when required, compilers are prepared to allow the inclusion more than once of the …

Member Avatar for vijayan121
0
163
Member Avatar for NathanOliver

Hey all, Three times today on three different computers when I went on to this site, specifically the c++ forum, I have received a anti-virus report warning me about an attack site. Has anyone else had this problem? I am attaching a screen shot of what Norton reported. Nathan Oliver

Member Avatar for NathanOliver
0
92
Member Avatar for NathanOliver

Hey all, I was taking a look at my stringstream conversion function and I couldn't decide how I want to handle a bad conversions. I used an exception and then in main I would a use a try, catch block to get any exception. [code=c++] #include <sstream> #include <exception> class …

Member Avatar for mike_2000_17
0
161
Member Avatar for NathanOliver

Hey all, I'm looking to upgrade my compiler and I was wondering if there is a compiler that is fully c++0x supported yet. If not is there one that is mostly supported? I am currently using MSVC++ 2005 express. I would like to stay in the MSVC++ family since I …

Member Avatar for NathanOliver
0
367
Member Avatar for NathanOliver

He all I am currently working a on a problem to convert the entire contents of an STL container into a string. For example if I had this: [code=c++] int foo[] = {1, 2, 3, 4, 5}; vector<int> bar(foo, foo + 5); [/code] I would like to convert [icode]bar[/icode] into …

Member Avatar for Bench
0
127
Member Avatar for NathanOliver

Hey All Yesterday I was writing a recursive form of a prime factorization program and I wasn't sure about the syntax I used. the function works as is but I'm curious if I am being redundant or if this is the proper way to code it. Here is what I …

Member Avatar for NathanOliver
0
134
Member Avatar for NathanOliver

Hey all I have been writing my own implementation of a BigInt class and I think I have most of it down. I am using a vector<int> container for my number. I'm curious to what you guys think about. This is my first program using 1000+ lines of code. Please …

Member Avatar for NathanOliver
0
151
Member Avatar for NathanOliver

would the workings of strlen() be something like this? [code=c++] int strlen(const char * str) { int size = 0; while (!!*str) size++; return size; } [/code] any feedback would be appreciated. also i have learned that !! will convert a value to an actual bool eg. !!104 = 1

Member Avatar for Ancient Dragon
0
149
Member Avatar for NathanOliver

Hey all. I have written a quine and I was wondering if I have the jist of it right. I'm not sure if the code needs to be longer or this would be a suitable answer. Here is what I have. btw driver.cpp is the file name for my source …

Member Avatar for NathanOliver
0
152
Member Avatar for NathanOliver

hi all. I'm not sure if its possible but can you call a different constructor inside a constructor of a object? ie can i have different constructors call a single constructor to set up the object [code=c++] class foo { public: foo(int) foo(double) //... }; foo::foo(int number) { this = …

Member Avatar for mrnutty
0
120
Member Avatar for NathanOliver

Hi all. I am currently writing a large number class and was curious if I should use a template. I am setting up my constructors and I have one for a string and i was thinking i could use a template for a constructor so it can take in an …

Member Avatar for NathanOliver
0
144
Member Avatar for NathanOliver

hi narue i would like to ask if this method should be called after ever cin statement? the reason i ask this is that if i write a program and i have 2 [icode] cin >> text; [/icode] statements then at the end before my [icode] return 0; [/icode] i …

Member Avatar for NathanOliver
0
127
Member Avatar for NathanOliver

Hi all. i am writing a simple log in program and i would like to have a class for users that stores the user name and the password as strings. after i have a user created i would like to output the class with the ios::binary flag set and store …

Member Avatar for NathanOliver
0
387
Member Avatar for NathanOliver

Hi i am building a program that will take the text of a supplied file and encrypt using a password then save the encrypted text in another file. To decrypt the file you must provide the same password used to create the file. the program encrypts the text at a …

Member Avatar for NathanOliver
0
152
Member Avatar for NathanOliver

Hi have made some code that will generate alphanumeric passwords and output them into a file. Each password size has its own function so i have 16 functions for sizes 1-16. The code works great its just that as you go up one size in the password size it will …

Member Avatar for NathanOliver
0
89
Member Avatar for NathanOliver

hi i have a very large array that i want to populate but i don want to run the for loops every time so i thought i would right a program to output text to fill the array and was wondering if this would work. the array is [icode] int …

Member Avatar for NathanOliver
0
107

The End.