General C++ Programming - January 2014 (Page 15)

for loop problem
 
My for loop incrementation seems to be ignoring the if statements rule, and incrementing every time, rather than just when the numbers are equal here is the ...
[2 replies] Last: of course!!!! i am kicking myself, thank you (by Xendraw)
printing the first n prime numbers (user input)
 
//Finding prime numbers #include <iostream> using namespace std; int main() { int n; //User input int num = 1; //number that will be tested if its ...
[1 reply] : Instead of looping n times you can loop as long as primeCount is less ... (by Peter87)
SOCI, ODBC, CMake and windows 7
 
I'm trying to configure SOCI under windows with ODBC. The core works but odbc doesn't. The problem is the it can't find soci-backend.h CMake tells me: O...
[2 replies] Last: Yes, you're right, but I'm using the cmake-gui where you do this with ... (by coder777)
multiple definition of ..
 
login.h #ifndef LOGIN_H #define LOGIN_H #include <iostream> class login { public: void addOrRemoveCashier(std::string role); private: int input...
[10 replies] Last: Hi, I am not sure why my build becomes successful in netbeans now. may... (by thomas chin)
Autostart FAIL
 
Hello Commulity, i had my program add itself to the registry. It creates a text file on its place with ofstream.(C:\) If you run the application, it creates ...
[3 replies] Last: THX coder777, i got it. (by jetkeynature)
Homework help? :-)
 
Hey everyone. I'm taking Data Structures right now. Just got an assignment back that I thought I understood and I got an F....owch. So I was hoping maybe someon...
[8 replies] Last: Yes. (by LB)
Learning more C++
 
So... I am a little unsure of how to phrase this, but I am trying to figure out the best way forward. Up to this point, most of my knowledge of C++ has come ...
[7 replies] Last: @L B Yeah, so I would like to see it changed! Is there a way that we ... (by BruceJohnJennerLawso)
by mhk313
making the current calender
 
Hi! I have a problem. I want to write a program that gives me the current calender for example like this: June 2009 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7...
[2 replies] Last: Some additional links to help with the tricky parts. http://www.cplusp... (by Duthomhas)
by Rahmat
how to bubble sort ??
 
Hi Everybody, I Want to create the function that reads unsorted informtions from one text file and sort them based on ID and then put the sorted informa...
[5 replies] Last: The "w", "a", etc is for the C file I/O functions ( fopen() , to be ex... (by Duthomhas)
Not sure what went wrong.
 
Hello guys, Can someone help me with this crash. I'm not sure where in the loop the program fails. Code Specifications: pCWN is a vector: vector <str...
[2 replies] Last: ne555, Thank you so much for the solution. I thought that was the prob... (by tacitus)
Arrays are actually created with a size indication?
 
Reading Effective C++ by Scott Meyers, and Item 16 claims that when an array is created, the compiler reserves a block of memory at the very beginning to indi...
[1 reply] : yes, allocating extra data in the beginning is a very common approach ... (by Cubbi)
infinite loop for pointer variable in link list
 
I am getting and infinite loop for loop pointer variable current which points to head and is incremented by current->next in while loop. I use the pointer varia...
[1 reply] : Your addNode function has an infinite loop: while(current) { ... (by abhishekm71)
The "using namespace std;" and "std::"
 
I have just started learning C++ and wrote my first C++ Hello World program. #include <iostream> int main () { using namespace std; cout<< "Hello World"...
[6 replies] Last: It depends on what you mean by 'after int main()'. The following is fi... (by LB)
std::map
 
A C++ container type called std::map is used to store elements that are formed by a combination of key value and mapped value. How do you iterate through this c...
[3 replies] Last: That's okay Script Coder, yours is in C++03 :D ... (by S G H)
HELP!!...i need an option to display all the items i have entered in alphabetic order .
 
i need one more option which it can display all the items i have entered in alphabetic order in my program.. this is my coding...... #include<stdio.h> #inc...
[1 reply] : Add a case 4 that does what your current case 3 would do and implement... (by closed account j3Rz8vqX)
Seed unique random numbers
 
Is there a way of using a rand-function in a way that it seeds the same random numbers every time the function is used? I'm looking fomr something like: int...
[4 replies] Last: #include <random> #include <algorithm> #include <vector> #include <se... (by JLBorges)
No one offered a solution
 
Sorry, I have a thread on this forum that my question was not answered. I thought that there was only one problem with my program, but it turns out that there i...
[6 replies] Last: Creating more than one thread for the same question is a bad way of do... (by MikeyBoy)
by hilft
binary search
 
I was told that the output can either be 11 or 10, but when I compile&run the code below, I only get 10 and I do not understand why the output is 10 instead 11....
[2 replies] Last: Yes, you cannot perform a binary search on unsorted sequence, that's f... (by Yueeng)
Else....
 
Hello I need help with the if else statement for this cipher I'm working on. I'd like the program to break the cipher when I hit enter. How should I write it? ...
[10 replies] Last: There is so much wrong with your program, that I seriously suggest you... (by TheIdeasMan)
vector or map names: Can this be a varbiable?
 
Hello and thanks in advance for the reply, I have a text file which is in the following format, it is called "words data.txt": word,word,word,word,... ...
[7 replies] Last: Solved. I had a neverending while loop lines 18 - 19 which was mention... (by tacitus)
January 2014 Pages: 1... 1314151617... 25
  Archived months: [dec2013] [feb2014]

This is an archived page. To post a new message, go to the current page.