Beginners - August 2012

by beakie
Inheritance/macros
 
Basically... I want to create some variables which, unless specified at compile time, aren't included in the compile. I was thinking of doing it like this: ...
[4 replies] Last: Why do you use preprocessor to cut out the inherited structures and n... (by beakie)
dnt nw what i am doing wrong
 
#include <iostream> #include <cmath> using namespace std; int main() { // The value of pressure in pounds per square inch of a wareform; const ...
[5 replies] Last: thank you ill work on it (by shagufa)
by Fliize
C++ UI
 
Hi everyone! Ive been making some programms in the summer, so that i dont become completely useless when school starts. Wanted to find a job, but everyone need...
[2 replies] Last: Check out QT: http://qt.gitorious.org/qt#more (by broser)
First time error :S help plz
 
error C2378: 'LPCELLFILE' : redefinition; symbol cannot be overloaded with a typedef It worked with my previous source and im pretty sure nothing was chang...
[5 replies] Last: will look into it...ty (by snaxpax)
Reset the consol
 
When I run this program on my consol the program will reset the consol window for each run. How do they do this? I want to be able to do this with a program I'm...
[16 replies] Last: "what's wrong with it?" It takes up more room, you can just make a fo... (by Shock Bolt)
How to make a file reader NOT read the contents of the file?
 
I have been coding C++ for a few days, and I'm learning it pretty fast, and I'm making an audio converter, so that you can convert AC3 to MP3, etc. I wanted to...
[2 replies] Last: Mhm, thanks, I fixed the problem anyway. (by Shock Bolt)
Using open to load a picture in picturebox
 
#pragma region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this met...
[4 replies] Last: Try changing picturebox1->ImageLocation = Bitmap::FromFile(); to pi... (by naraku9333)
by jaded7
Memory allocation
 
If, for example, I have the below snippet int *pInt = new int ; Is there a way of testing whether the memory at or above pInt is free, or in use?
[2 replies] Last: If new throws an exception, it couldn't give you the memory you asked ... (by Moschops)
For loop using the modulo
 
My brain doesn't seem to be working at all today. Here's my problem. Imagine having an array of integers, but i want to add up these integers from a pair of ...
[6 replies] Last: const int N = 10; for ( int i = 0; i < N; i++ ) { for ( int j = i, ... (by vlad from moscow)
What the code trying to do
 
int noname(const char*p) { char *r = (char*)p; while(*r!='\0') r++; return r - p; } I not really understand how the code ...
[5 replies] Last: @Script Coder Not to be pedantic, but vlad please change the ';' to a... (by vlad from moscow)
reading from file.txt to array of strings.
 
hello i have a little question here. i have read the tutorial, but didn't quite understood how to work with input/output to/from files. let's suppose i have a...
[3 replies] Last: hi everybody! sorry for the double post. after a bigger search, i fou... (by Stauricus)
random number
 
Hello ! I'm knew here , and having a problem . I'm trying to make program that picks numbers between 1 and 100 , and lets the user guess what the num...
[5 replies] Last: OH it starts from 0 not 1 thank you I appreciate your help (by freedom12)
by bdolr
Trying to make program for my daughter
 
Hi guys, brand new to the forum, and programming in general. I just started learning how to use c++ this week, and wanted to make a console application to hel...
[19 replies] Last: Will do. Last night i was watching videos on youtube, made by krashcou... (by bdolr)
Header file problem
 
I have written this program-> //header.h #include <iostream> #ifndef HEADER_H #define HEADER_H struct structure { void add (int,int); }; void struct...
[2 replies] Last: Thank you actually i forgot to mention the namespace std. (by bigo005)
by mahone
f()=X()??
 
Hey, Please Correct me if I am wrong,when an expression contains '=' sign then the expression on the RHS of '=' sign is evaluated and the result is assigned ...
[3 replies] Last: so, is = a member function of every class by default? Yes.... (by Peter87)
help with const char's and string literals!
 
I am completely stuck in comprehending Sections [10.2] String Literals revisited and [10.3] Initializing arrays of character pointers in Accelerated C++... Sup...
[1 reply] : It's not that char arrays are different. It's just that the operator<<... (by Peter87)
by mahone
Default constructor????
 
Hey, I was going through the following Example in my book: class X{}; X f() {return X();} void g1(X&) {} void g2(const X&) {} int main() { // g1(f()); Err...
[1 reply] : If no constructor is declared for a class then the compiler declares t... (by vlad from moscow)
is this unconventional or bad form? (cont..)
 
The previous thread wouldn't let me edit so here is the code I was posting. #include <iostream> #include <vector> #include <string> using namespace std; ...
[5 replies] Last: Everyday, I am surprised by the courtesy of everyone on these forums. ... (by RastaWolf)
printf() : header file not required???
 
in C language we make use of printf() function for standard output. from all the resources i have referenced, they say you should include <stdio.h> before using...
[1 reply] : You are using an old C-compiler that follows the C89 Standard where fu... (by vlad from moscow)
How would i go about doing this? I am new to C++ and taking a class for it, and just want to see what this might look like.
 
What would a code segment look like that defines a class definition for student, also including two properties and two methods. And a reason to why there is a p...
[1 reply] : class student { // members, usually left private public: Type f... (by ToniAz)
August 2012 Pages: 123... 45
  Archived months: [jul2012] [sep2012]

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