Beginners - April 2010 (Page 10)

Mixing C and C++
 
Hello, I was wondering if there was any reason that I shouldn't write a single program using commands from both languages. I wrote most of it in what I believe...
[1 reply] : C++ was designed to work with C, so yes, you can mix and match. Jus... (by Duthomhas)
dispaying files
 
Hello, I am trying to display all the files/folders in a directory including the files that i do no have permissons to. Also I am using the BOOST library ...
[6 replies] Last: The Boost Filesystem library is what you want to use. http://www.bo... (by Duthomhas)
programmer defined function
 
#include <cstdlib> #include <iomanip> #include <iostream> using namespace std; //Function Prototype bool isMultiple(int X, int Y); /******************...
[3 replies] Last: by the way this is where i am now. int main() { int X; int Y... (by xaNDER90)
by fyodor
overloading operators<<>>, virtual functions
 
All that i have to do is write class Vector2D and then implement some methods: class Vector2D { double x,y; virtual double GetLength(); virtual void P...
[11 replies] Last: your compiler is complaining about this: in<<this->x; it should ... (by m4ster r0shi)
Warning: Initialization is only partially bracketed
 
Hi, I am trying to program a game that uses large tables of numbers for the maps, which look like this: int map = { T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,W,W...
[7 replies] Last: Wow... that's a lot of letters. Anyway, g++ and MinGW are strongly ... (by Albatross)
Simple noob question
 
Hello folks, I'm coming from the classic VB 6 and I'm facing some dificulties to perform simple tasks with C++. For example, how would be the correct way to ...
[7 replies] Last: The setfill one has an example just like your first question... (by moorecm)
vector
 
HI. I have a problem in vector . after insert number in vector when i want to use cout for show vector compiler show another number 1 2 3 //////////////...
[4 replies] Last: Seems that jsmith and firedraco well beat me to this. Don't instant... (by Albatross)
by dumas9
trying to access a variable in a header file
 
This is what I want to accomplish: Header file - abc.h #ifndef ABC_H #define ABC_H extern bool myBool; #endif CPP file1 - abc1.cpp #include "abc.h" if...
[15 replies] Last: Allright...there are a couple of good tips here. Let me try these out ... (by dumas9)
by Morph
Compile Error
 
// DeckOfCards.h class DeckOfCards { public: DeckOfCards(); void shuffle(); void deal(); private: int deck ; }; // DeckOf...
[3 replies] Last: Wow thanks a lot . (by Morph)
Printing a file
 
I am writing a program where I want it to automatically print some reports that I'm generating. Is there a simple way to send a file to the printer to print in ...
[2 replies] Last: No, I want to take a created file and output it to a printer to create... (by dwinters)
by pika
recursive binary search
 
i have here a simple recursive binary search. it seems to work well enough until i try to search for a value that does not exist. why doesn't it work? woul...
[11 replies] Last: if there is, then what is it? http://www.cplusplus.com/reference/st... (by imi)
Code does not run in c++visual studio
 
Hi, I'm new in programming. We just learned how to use functions. In my opinion, i did everything ok in my program, but the code does not run in C++ studio 2...
[4 replies] Last: Hmm.... The problem is that your IDE isn't pausing. Read this very ... (by unoriginal)
OSG Globo Loco?
 
This is a *simple* homework assignment. I have to make a model of the solar system using the OSG libraries. I have created all of the planets and the sun and...
[no replies]
For Loop Syntax Question
 
Hey all, I have a question regarding this syntax of a for loop, or atleast to find out if this is valid code and why it produces the value it does. I can't f...
[4 replies] Last: Hi unoriginal and thank you. Yes, you explained it clearly and help... (by wolfcry)
Trouble resizing array
 
Hey there, I'm having trouble with my ResizeArray function, I don't know if there's something wrong inside the function itself, or simply the location of the fu...
[1 reply] : You cannot delete a C style array. Use the STL if you must to resiz... (by unoriginal)
Including Header files
 
Hi all, Is there any hierarchy while including header files, like complier provided header files(stdio.h) has to be included first and then the user defined ...
[7 replies] Last: #pragma once is nice since it lets the compiler skip the file instead ... (by firedraco)
codes
 
do any of you know any sites or dose this one list codes for programing many things?
[4 replies] Last: Thanks for those sites blackcoder41. I've never seen them before. They... (by Mythios)
by cmccmc
whats the #ifdef whatever for linux?
 
If you only wanna make something defined under windows you use #ifdef _WIN32. What would you use for linux?
[5 replies] Last: Most Linux systems are POSIX complaint (Portable Operating System Inte... (by unoriginal)
sorting a vector
 
Hello, I am working on sorting a vector. Currently i have a 3d vector created each element consists of a string and 2 other numbers. I was planning on just l...
[8 replies] Last: struct foo { bool operator<( const foo& rhs ) const { ... (by jsmith)
by jyp010
Classes
 
I need to know 5 advantages about using a class. If you can explain them that would be great!
[3 replies] Last: Class's that students are in usually have homework, that you should d... (by firedraco)
April 2010 Pages: 1... 89101112... 35
  Archived months: [mar2010] [may2010]

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