Beginners - January 2011 (Page 6)

Read From File in Visual Studio 2010, Where Do I Put the File?
 
Title says it all, really. I'm working on a simple project for a class to read in data from a text file, but the code can't ever seem to find the file. Does any...
[3 replies] Last: I figured that was the case. It doesn't need to be in the folder with... (by Return 0)
I don't understand this Example
 
My book gave me this example and I don't understand the wording of it at all. Any help on this? It is important to realize that when a base- and derived-cl...
[10 replies] Last: I pass all credit to the guestgulkan :) (by Moschops)
how to use qsort from <stdlib.h>
 
How do I use the qsort() function? I have a string array of 5000 phone numbers and I know that there are 4 arguments, but I can't figure out how to enter the 3...
[3 replies] Last: Look at the example; qsort (values, 6, sizeof(int), compare); a... (by naraku9333)
Code::Blocks, linker and libraries
 
I'm new to C++ and I'm even newer to all that other stuff like compiler, linker, libraries etc.. I just switched from Microsoft Visual C++ 2008 Express Edition ...
[6 replies] Last: I use the default to link dynamically: g++ bad03.cpp (size 7547 kb... (by Moschops)
by JayCee
Problems grasping logic (1,2)
 
I am experienced in BASIC programming and would love to learn C++ - this is my second attempt to do so. I have written complicated BASIC programs of many tho...
[21 replies] Last: I found this site a number of months ago containing the contents of Da... (by PanGalactic)
Simple(?) Array Manipulation
 
I'm struggling to find the answers to these simple questions. 1. Let's make a 1-D array: float x ; Now, is there a way of performing operations on ...
[3 replies] Last: [quote=jazpearson]2. Then let's consider a 2-D array: float y... (by PanGalactic)
different types in for loop
 
can i do the following and how? for (double it=0,int i=0;it!=5.0;++it,i++) { ... } different types of variables in the loop..
[7 replies] Last: Yes. It was all completely legal, but I just knew someone would com... (by Moschops)
Random selection from vector elements
 
Hi, I have a vector SP but the number of elements (size of the vector is not constant) are changing. I want to select one of the elements randomly. For...
[1 reply] : use rand() with remainder division (modolus %) of the size of the arra... (by wolfgang)
Computer choosing a random number
 
Currently i'm making a game. and i don't know how to let the computer choose a random number between 1 & 3.
[9 replies] Last: You're code should be fine to post here. I would help in the PM, but D... (by wolfgang)
Code review size
 
Hello! I'm currently learning C++ along with SFML, and I've been working on a space shooter. I would like to post the code to hear your suggestions and correcti...
[14 replies] Last: [quote=Davitosan]I still haven't fully understood OOP yet, as you clea... (by closed account z05DSL3A)
by mpj88
Can someone please explain this (1,2)
 
Hi can someone explain this piece of code for me: void printTree(struct node* point) { if (point == NULL) return; printTree(point->left); co...
[24 replies] Last: Thank you for trying to help me with this. Talking about classes we u... (by mpj88)
Dinamic array
 
int n = 10; double *t=new double ; for (int i = 0; i < n; ++i) { t =1e2; ...
[5 replies] Last: I`ve found the error!) In debagging mode the array is displayed like... (by Romanoffff)
for school, dont know what to do
 
so im a new comp sci major in college i did good last semester and now im in a new semester with a different teacher, well apparently in the first semester we s...
[11 replies] Last: well i finished the program and finally did it haha thank you all for ... (by sorthon123)
ifstream read error
 
Hey guys, The following code reads in all the data from my input file correctly, and even outputs it correctly. But at the end the infile.fail() message is di...
[2 replies] Last: Ok it works, Just chaned it to... if (!infile.eof()) if (infile... (by closed account zwA4jE8b)
Using "std::ostream" in my class
 
Problem lies in my class. I have a constructor where &cout is passed. In my constructor its SpyOutput::SpyOutput (std::ostream * k) { *k << "something"; ...
[3 replies] Last: Nevermind i foudn the problem: class SpyOutput { int count; s... (by matthewfs)
Single question about a common abstract data type
 
The ADT is a node for an AVL tree. I understand its basic makeup--data/object, left node pointer, right node pointer, and height (for balancing). The class that...
[2 replies] Last: You da man. Thanks so much! (by ItchyElbow)
Why use SQL
 
1st.) I'm still new to C++ so I'm not being condescending, it's a legit question. I see a lot of post, and walkthroughs mention SQL, but I don't see how/wh...
[10 replies] Last: If you want an example of how you can have so many records, To ad... (by Disch)
GLfloat not working in header file
 
I'm tring to declare GLfloat inside my header file, but its not working; I've included all the necessary files but still isn't working on this project. I'm rece...
[1 reply] : great I fixed it "#endif" has to be added at the end of the file (by Blessman11)
errors in my code
 
i have looked at multiple tutorials including one sent to my by return 0 and my code says i have errors on line 63. it says choice undefined first use this fu...
[6 replies] Last: I don't want to get you down, but if you're new to C++, you shouldn't ... (by packetpirate)
Errors
 
Hey guys wanted to ask what's the difference between the fatal error and the run time error , the compiler error ...
[2 replies] Last: okay thanks framework... (by billyb29)
January 2011 Pages: 1... 45678... 42
  Archived months: [dec2010] [feb2011]

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