General C++ Programming - October 2012 (Page 8)

Cannot understand this syntax...
 
I have this part of a program, where the matrix is initialised with n x n values of "true". vector< vector<bool> > adc(n, vector<bool>(n, true)); for...
[6 replies] Last: @Moshops Could have been a char. Or a string. Or a longer int type. ... (by jumper007)
Stek
 
For each functions will be allocated new stek memory. Fine, but where it be? Heap, guess no, probably in general stek, or I missed a point?
[2 replies] Last: In computer programming, a stack is a container that holds other vari... (by jumper007)
Find the top 3 numbers in a list
 
I made a list of numbers that the user inputs, and then the program has to find what 3 are the largest, but im not sure how to find the top 3
[4 replies] Last: The easiest way is sure the STL sort() function, but I guess you ... (by jumper007)
debugging suddenly stops
 
for(i =0; i< 2500; i++){ if(i==k){ dist =100000; continue;} euc=0; for(j=0;j<2;j++){ euc+=(v.at(i).at(j)-v.at(k).at(j))*(v.at(i).at(...
[5 replies] Last: Lines 11 to 15 look suspicious. As written: for (i=0; i<2500; i+... (by Chervil)
char array
 
hello, so i have two char array and basically i want to do this: char message ; char word ; message="arts"; word=message; ...
[4 replies] Last: In C/C++ there is no assignment operator for arrays. You have to use ... (by vlad from moscow)
Ogg Vorbis Exeption Error
 
I'm following this tutorial(http://devmaster.net/posts/2895/openal-lesson-8-oggvorbis-streaming-using-the-source-queue) to learn how to implement .ogg files. Ho...
[7 replies] Last: For some reason I needed to link static versions of the libraries T... (by Moschops)
it keeps crashing when i enter password
 
I made this script, and it compiles with no errors, but when i type in the password, it says "program" stopped working? #include <iostream> #include <queue...
[1 reply] : char *password = "test"; In C and C++, anything inside " symbols ... (by Moschops)
Asteriks Triangle Nested loop
 
I've been trying to do this asteriks triangle with nested loop for days and many hours and still no luck. Im using visual studio 2010 and I've been searching th...
[1 reply] : Please use code tags in future posts, before you press submit, look d... (by Kart)
2D vectors
 
I am trying to send a 1D vector to 2D vector. I have a table consisting of 2500 rows and 3 columns. I recorded these vaiables at a vector having 7500 spaces...
[2 replies] Last: thank you. this works (by noktalivirgul)
printing vectors ERROR
 
hi; i wrote a code taking inputs from a file and then send these inputs to a float variable. for(vector<float>::size_type j=0;j<3;j++) { myfile >> y...
[4 replies] Last: thnak you this worked with () instead . (by noktalivirgul)
expression must be a modifiable lvalue
 
I get something wrong at line 45 with C board when I add two board in "add" function. I had modified "unsigned long" in fron of "fb" and "fc". But it just effec...
[2 replies] Last: Thanks! I'll try your way! (by Tekaru Oka)
Input of C program
 
I want the program can do that for me. When I enter the name of file in the same folder of .exe, the program will scan the file data and print it out the data i...
[no replies]
by ekbass
Pointer Question
 
I have a question about passing a pointer as an argument to a function. I'm creating a binary search tree and am trying to insert a node into an empty tree. Th...
[4 replies] Last: The problem is: root = node; No, clearly root is a Node* as spe... (by cire)
Is this ok for a 2D dynamic array?
 
Hello, I'm using this code in a project where I need to use a dynamic 2D array. So far it's working, but in a particular circumstances where I try do add an ...
[1 reply] : So, you're leaking memory every time you call this function. I suspec... (by cire)
by Ammo
switch statements using int
 
Hi, I am somewhat new to C++. I am testing switch statements to better understand how they work. I created a simple program, but my program is not functioning...
[6 replies] Last: Yea I realized it after. If I was using char it would have been okay.... (by Ammo)
Cannot access data struct members after looping a couple times.
 
Hi guys, I have a a loop that creates OpenGL display lists and uses a data structure with data structures in it to create them, but every time I near the en...
[1 reply] : I have figured it out. All it took was time :) It turns out that when ... (by snow 56767)
Interest Rate will not Display as .06, .6, etc.
 
I created the program below for an assignment. You are supposed to be able enter in your original principal, minimum interest rate, maximum interest rate, and n...
[1 reply] : @DarrelLopez (1) Don't make pointless posts like that, you could be r... (by TheIdeasMan)
Passing Parameters: Days of the Week Re-Write
 
I've read all the corresponding material in the book and have no clue what to do. Any help would be appreciated. Here are the instructions: Rewrite the ...
[1 reply] : The book really had nothing about this? You're going to need to emplo... (by Branflakes91093)
Trying to find the mode of an array
 
Hello all, and thanks in advance for any help you provide me. What I'm trying to do is find the mode of an int array, or most often occurring value. Below is wh...
[11 replies] Last: I'd love to see the code sounds interesting (by gsizzle10)
OpenGL linker problem
 
Hey agian, I installed Sfml and have been using it witout error and now I decided to try out the openGL capabilities. unresolved external symbol __imp__glCle...
[10 replies] Last: Did you add "SFML/Graphic.hpp" to your program? OpenGL headers is incl... (by majidkamali1370)
October 2012 Pages: 1... 678910... 50
  Archived months: [sep2012] [nov2012]

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