Beginners - August 2011 (Page 22)

by Ptbr
Unsual end with vectors
 
Hi everyone. I'm having problems with a code using vectors, the code sintax is right, but it terminate in a unespected way. The prompt says that the appli...
[1 reply] : You are iterating out of bounds on your string/vector. Use i < epc.le... (by Zhuge)
by zedius
fstream: Why must my files contain the path to load properly?
 
Can you tell me why the files I'm loading in the code below will not load without their full file paths? The files are in the same directory as the executable. ...
[3 replies] Last: So the current working directory is not guaranteed to be the director... (by andywestken)
fstream.read, make struct from bytes.
 
I made a class for the G2DA file format for Dragon Age: Origins modding and it all went well in C#. I want now a real challange and began doing so in C++. I sta...
[8 replies] Last: Yeah, found out that. The pointer being 32-bit made it so I could read... (by GisleAune)
Using if and else help?
 
How can I attempt where if the user puts an invalid value he/she will be prompted with a negative warning repeatedly until he/she puts the associated number req...
[10 replies] Last: I recommend you start with the tutorial on this site, if you haven't a... (by anonymous23323124)
by codrgi
where to download this library?
 
nvm!
[no replies]
String printing garbage
 
#include <stdio.h> #include <stdlib.h> #define MAXINPUT 100 char *getinput() { int a; char*string=malloc(MAXINPUT+1); char*stringhead=string; ...
[8 replies] Last: Chances are the memory you're allocating is "clean" meaning it's 0000... (by Catfish)
Code help
 
Hi everybody, I'm new with c++ hence this post being in the beginners forums, but anyway, I've been working on a project for a while now, and I think the main p...
[no replies]
Postfix and Prefix
 
Hey guys I am having a problem with getting this program : #include <iostream> using namespace std; int main(){ int z,x=5,y=-10,b=2,a=4; z=x++ - --y*b/a; ...
[4 replies] Last: Thats because ++ or -- used as a prefix are computed instantly and ++ ... (by AleaIactaEst)
cant use j as an iterator?
 
here is the code: for( std::size_t i = 0 ; i < monsters.size(); i++) { for( std::size_t j = 0; j < bullets.size(); j++ ); { if( monsters ->IsHit( bullets[...
[1 reply] : Trivia, I don't think you need std:: before size_t . It should be a... (by Catfish)
Adding a node at the TAIL in a linked list
 
struct node { int data; struct node* next; }; void Push(struct node** headRef, int data) { struct node* newNode = malloc(sizeof(struct node)); newNo...
[15 replies] Last: Andy, you are 100% correct. I was reading about it: This is a must rea... (by Sputnik)
Hi plz explain m a Beginner in c++
 
class car { int millage; int cost; public: void get() { cin>>millage>>cost;// THE INPUT I ENTERED HERE IS NOT GETTING STORED IN MILLAG...
[10 replies] Last: wow Mr.rambo1177 Thank you so much a... (by vandhanarm)
by wynjoe
Case code showing more than once
 
I was wondering why does my Switch code part shows "Incorrect value. Please try again.\n" several times if I enter something like "yyyy". If I enter 5 letters o...
[1 reply] : Firstly, this is horrible code (and is not C++ - if your compiler is h... (by Moschops)
A simple C program writen in Visual c++ 2010 that dosen`t work!
 
#include "conio.h" main() { putch(getch()) ; } I am a noob i know:)!
[1 reply] : In C++, main() is just plain wrong. main returns an int; int main(... (by Moschops)
Using a Iterator
 
I have two <int> vectors: Customers and Wait_Times. The position of an entry in either vector will represent data about the same customer. So if I find Custom...
[6 replies] Last: What is the type of "my_wait"? (by firedraco)
cin & cout in Visual C++ 2010
 
Hey Guys, I just downloaded Visual C++ last night and copied my code from Dev-C++ to Visual C++. When I gave the command to Build, the following error came for...
[11 replies] Last: Oh shit I suck ..... I thought I had (by tejas1995)
Conversion program
 
I'm a beginner with C++ and decided to make a quick conversion program. It does everything I want it to, except for one thing. When I have it convert from meter...
[2 replies] Last: Your problem is this line: if (var1 == "AU"); The semi-colon ... (by shacktar)
by smelas
accessing enum members
 
AheaderFile.h is something like this; class Fruits : public CompositeFruits { public: enum FruitType { apple banana }; in my code...
[4 replies] Last: it works now. thanks. (by smelas)
truly random number
 
I assume the reason why the number(s) are static is because I'm doing something wrong... int x = rand(); cout << x; Output: 41 How do I make a tru...
[8 replies] Last: [quote=Zhuge] Erm, you'd need something to generate a random memory ad... (by ModShop)
by Barbon
Best language before C++
 
Whats the best language to learn before moving onto the more deeper C++? Is there one which is a good language to learn to get to grips with programming in gen...
[11 replies] Last: If your new to programing in general i would recomend html,javascript,... (by exton132)
Sending cout to a log file.
 
Hi, I have been trying to figure out how to write all of my cout to a txt file, so that I can look at it later outside of the terminal. I can easily do th...
[3 replies] Last: @andywestken: That worked perfectly. I didn't think to pass the ostre... (by anotherghost)
August 2011 Pages: 1... 2021222324... 39
  Archived months: [jul2011] [sep2011]

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