Beginners - December 2012 (Page 3)

by bdwg
Declaring a vector in a header file.
 
I have two problems. 1. I would like to make a vector with initial length, say 10, within a class. The vector's elements are from another class. Class P...
[2 replies] Last: Thanks! For anyone who this might help: To fix it, in the constructor ... (by bdwg)
storage size of array isnt known error
 
i am not really sure what to do. char a ; I thought that this was the way to declare an unknown array? I was initially trying to convert the string into an ...
[2 replies] Last: A string is already an array of chars. You can obtain a pointer to the... (by Cubbi)
Use of "%" operator in this way.
 
I need a little help in understanding this, if someone could. if ((iii % 3)==0) continue; I was told that if iii was divisible by 3 the if statement...
[1 reply] : It's the modulus operator: its job is to divide the left operand by th... (by closed account zb0S216C)
attempting to index strings
 
coming from python this would seem like valid code, but it gives warnings and "-fpermissive g++ will accept your code" So i am assuming there must be a bette...
[4 replies] Last: ah yes, the {} and semicolons. I always forget them. Thanks I have an... (by metulburr)
by soje
chai.lib
 
I'm trying to build a soultion in MVC++ 2010, a JUCE interface. However, when I get this error: LINK : fatal error LNK1104: cannot open file 'CHAI.lib' ...
[2 replies] Last: Thanks for your kind reply :-) I guess I wasn't quite clear. I realiz... (by soje)
by adrem7
Getting used to functions (tidying my code)
 
I have several long pieces of code, but never bother using functions in them as it is just another thing to learn. I just wanted a bit of help with creating my ...
[1 reply] : I suggest you to look at std::valarray it allows you to operate wit... (by ne555)
confused on results
 
I am confused on why while (! (cin >> num_grade)) would be false on the condition the input was not a number, being num_grade as type int? #include <iostre...
[2 replies] Last: ok i didnt know that it has the ability to do that by itself, thanks. (by metulburr)
std::cout and using namespace std?
 
What's the difference between std::cout and using namespace std? is std::cout a difference programming?
[13 replies] Last: I prefer to use it. Always avoid it in header files, though. (by moorecm)
unable to overload function
 
How come this works for int and string but it wont for float? #include <iostream> using namespace std; class Builtin{ public: void print(std::str...
[2 replies] Last: Or use float the specifier on your floating point number: build.print... (by jlb)
Is there a difference between the terms: Dynamic Array and Variable Length Array?
 
Hello there! While looking at the google C++ style guide I noticed they mention they don't allow variable length array s (VLAs) in their code. I was jus...
[6 replies] Last: Thank you very much, those are interesting thoughts. :) I appreciate y... (by joseplusplus)
Validation from values in a Vector Array
 
I'm trying to do a validation from int values in a vector. I've tried using pointers and a bunch of different arguments in while and do-while loops with no avai...
[1 reply] : There's no way for us to advise you without seeing your vector and how... (by Zhuge)
by flony1
questions about implementation and linking
 
hello friends ... I will not be breaking the rules of the forum with the question that will, no studio on vacation programmer and I said let's read a book of c ...
[2 replies] Last: thank you very much. The solution to my problem. static libraries. arc... (by flony1)
g++ supports two ways of calling a function from the std namespace
 
Hi there, I'd like to know why is the following code correct according to g++: #include <cstring> #include <iostream> int main() { std::cout << strlen(...
[2 replies] Last: the standard specifically allows implementations to include strlen( ) ... (by Cubbi)
Urgent help required for a grading system
 
hey guys, im new to C++ and im doin an assignment. In my problem, you gotta search for a student's name and then make the program display the name, correspondin...
[3 replies] Last: @jlb and @Chervil , thnks so much guys!!! I tried it n it works! how s... (by skyfirestalker)
including header causes error, but including cpp does not
 
in main.cpp if i include the header files, it raises the error metulburr@ubuntu:~/Documents/cplusplus/composition$ g++ main.cpp -o main /tmp/ccb7S83C.o: In fu...
[4 replies] Last: > What if you wanted to distribute the source instead of pre compiling... (by JLBorges)
vector subscript out of range
 
I've been using visual C++ Express to work through some elementary exercises... After I receive the message "vector subscript out of range", I am given the ...
[4 replies] Last: #include <iostream> #include <string> #include <vector> #include <alg... (by JLBorges)
Rename Problem...
 
Hi! Look At this code: #include <iostream> #include <conio.h> #include <cstdlib> #include <cmath> #include <fstream> #include <string> #include <stdli...
[3 replies] Last: I didn't get that particular error. But it would suggest the remove()... (by Chervil)
seekg = sekkp ? :|
 
Hello ! I read about seekg and seekp,but i didn't understood what they do.... I've tryed this both codes: #include <iostream> #include <fstream> using...
[5 replies] Last: Yes, this is what file streams do. They have only one position, both s... (by Cubbi)
What certains things do?
 
Hey are there any sites that say what certain things do? For example, lets say i wanted to know what a float was or what writeprocessmemort does, i would just t...
[2 replies] Last: At the top of this very page, there is a search box. :) (by Chervil)
array problem, pointer dynamic memory???
 
am using c++. i have this code which prints out a result like this on the screen ; first numbers are ; 23, 25, 56, 75, 65, second numbers are; 45, 87, 90...
[1 reply] : Sure, that's what std::vector is for. (by Athar)
December 2012 Pages: 12345... 65
  Archived months: [nov2012] [jan2013]

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