Beginners - June 2010 (Page 18)

by dandy
problem free(buff);
 
char *buff; void minterm(int x) { static int z=x,a=0; if(z==x)buff = (char*)malloc(x); for(int i=0;i<=1;i++) { buff[x-1] = (i+'0'); if(x>1) ...
[13 replies] Last: Technically most C programs are valid C++ programs. If you ask your... (by Athar)
by hogren
Libogg on Cygwin
 
Hello, I have Cygwin (on vista). I downloaded libogg 1.2. I perfom the commands (in the libogg's directory) : ./configure make make install No error, but...
[3 replies] Last: I don't know. But many generally available packages, such as this, ... (by kbw)
question about returning pointers by reference
 
I have the class below, class List{ public: Node *pstart; Node *& function(){ return pstart; } ... ...
[2 replies] Last: thank you!!. I was declaring the const before the * (by santiagorf)
by rhouli
Memset an Array to -1
 
I want to use memset to set an array of length framenum. I know how to do it for 0 memset(arrayname, 0, framenum*sizeof(int)); , but im not quite sure ...
[1 reply] : You don't use memset in C++, but rather std::fill or std::fill_n (defi... (by Athar)
C function calls extern "C" function in c++
 
extern "C" void ks_steddy_Cut(float x,float y,void *model); function in C++ .And when I call it from c(in vs). I use step tools and found that the parameter au...
[no replies]
Calling Virtual Function in a constructor
 
Consider the following code.. class base { base() { printfunction(); } vir...
[5 replies] Last: Thank You guys.... This forum is helping me a lot to get the basics ri... (by karthick88)
Does not pause to allow input (1,2)
 
OK, I am really, really new at this. Let me paste my code, and I will put at the bottom what I am experincing There is a .h file and another .cpp file also tha...
[31 replies] Last: No problem. Please read back in the posts about what it actually does... (by droshki)
by kcad
srand _random numbers aren't random!
 
Don't know why program is not generating random numbers.
[4 replies] Last: never mind! (by kcad)
having a dll show a form
 
Hey guys, so I am using VC++ and I am making a dll, it's an addon for a game I play (they allow custom .dll's to customize the game, you can only play it in sin...
[no replies]
recalling an object within its class
 
I am trying to write a class that will run functions on the specific object from within that class. I am not sure what this type of operation is called. example...
[2 replies] Last: setAge( age ); (by jsmith)
Re-malloc memory pointer
 
I have some code where I open a file and store it in a malloc'd location with 'char *p' as the pointer. After reading the data I need from there, I call the sam...
[1 reply] : You'll have to show some code to see what you are doing wrong... (by Duthomhas)
by aleal
Returning a pointer as a reference
 
Hi, Consider the class: class MyClass { public: MyClass() : myPointer(0) {} const int& getMyPointer() const { return *myPointer; } pri...
[2 replies] Last: @firedraco Wonderful. Thanks. A. (by aleal)
by fafner
file io binary mode
 
Hi! I have, until recently, consequently written "using namespace std;" at the beginning of all my c++ programs. However, upon realizing the possible threats of...
[4 replies] Last: Just a shot from the hip, but would there be a way to #ifdef the inc... (by Computergeek01)
Comparing 3d Point struct for equality
 
Hi all, I have a structure of 3d points defined as such: struct Point { double x, y, z; }; I also have a vector of vectors of points: ...
[5 replies] Last: While I like (and use) Boost, the std :: rel_ops namespace also prov... (by Duthomhas)
Tic-Tac-Toe reaallyyy weird error
 
So I tried to make Tic-Tac-Toe but stumbled upon this very odd issue. After I say that char sq1 = char playersymb sq1 doesn't change! help please? ...
[4 replies] Last: Thanks guys! I see it all works now! Took out some stupid faults an... (by xander333)
by jwpj
Beginning C++ for real
 
Hey all, I have always hated programming. But lately, I have started to see a real art in code, and have decided to learn c++ on my own. I took a C++ class i...
[12 replies] Last: Code::Blocks, as I've talked about in another post lately, is not GNU ... (by closed account S6k9GNh0)
Not take into account negative average
 
int main() { int age ; int i,sum=0, avg=0; int max=0,min=100; for(i=0;i<10;i++) { cout << "Grade " << i+1 << ": "; cin >...
[3 replies] Last: Ah. Well, you would put it where you're outputting the average, of cou... (by Athar)
A pointer Problem
 
Hi i wrote some code to calculate the max value of an array or something like this but i couldnt find the error in the program but i think the pointer created i...
[15 replies] Last: Yep.There are several methods to write a program doing the same task b... (by systempause)
Compilation error with prototypes
 
I need a little help since I keep getting these errors while compiling. I can't find an answer that helps me out via google. I keep getting this error... "bo...
[10 replies] Last: Oh, that header is really big. It also comes with a .c file. Thing ... (by melshki)
Linked Lists
 
Hello, I'm trying to create a linked list in c++, but its not working out too well. Any suggestions to where i'm going wrong would be great. Here's what i have...
[7 replies] Last: If you are new to C++ my suggestion would be to learn how to use the s... (by kempofighter)
June 2010 Pages: 1... 1617181920... 26
  Archived months: [may2010] [jul2010]

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