Beginners - July 2013 (Page 18)

File Input & Output: List Error
 
This program reads a few lines from a list located in a text file. Each line contains data about a person and his or her score. The program should then output t...
[11 replies] Last: It's both I think! and I am not kidding. good because It gives you so... (by closed account 28poGNh0)
ofstream not writing all variables
 
Hello all. I have this code here that is supposed to save all the values in a file, and it does that in vSave(). Also, you can load the values with vLoad(). ...
[2 replies] Last: Ah I fixed it. void vLoad() { ifstream fileStream("save.dat", ios... (by undeadsoldier)
by nmn
copy constructor error
 
Hi All, What Am I doing wrong ? because as soon as the COPY CONSTRUCTOR is called at IntArray e(c). More specifcally, at this line arrayPtr = obj.arrayPtr; I g...
[2 replies] Last: thanks...helped. (by nmn)
Type Casting Help Required
 
char * a , *b; void search(string main,string second); the question is that if i pass char * to this function will it recieve it and function properly ?...
[1 reply] : Whether the function will work correctly nobody knows except you.:) (by vlad from moscow)
by Slazer
Output C style string with std::cout
 
I tried this code string str="abcde"; const char* c_str; c_str=str.c_str(); cout<<c_str; and it puts "abcde" on the output. I expec...
[1 reply] : << is overloaded to treat const char* as string data rather than a p... (by Disch)
SDL_image not SDL
 
I found some different code that had less errors. Now the only error I am getting is [Linker error] undefined reference to `IMG_Load' My code is: #...
[16 replies] Last: Got it to work. Thanks for all your help. (by closed account NUj6URfi)
Maximum value C++ using #define
 
Hello, To compare between tow values and return the largest value between them can be done by the following code: #define getmax(a,b) ((a)>(b)?(a):(b)) and f...
[3 replies] Last: I am sorry I did not make my question clear. Those codes are two separ... (by Sabratha)
by ben353
Segmentation fault in vector
 
Ok so I've made a little game using SDL but when I try to 'destroy enemies' in a radius of my character I try to remove the x and y coordinates of the 'enemies'...
[1 reply] : It's ok figured it out! I had to return the bool to false after the 'i... (by ben353)
Type spcifier
 
Hi all, I'm working on this homework problem but am having trouble with the way I make reference. For instance, I get an error " error C4430: missing type sp...
[3 replies] Last: line 66 - you are returning values in a function which returns nothing... (by c0defisher)
Array Help!
 
Hi, I am trying to make an array of 16 in windows form application with visual studio, but I am not sure how to do that with a float. I want the array to be in...
[2 replies] Last: Sorry about that. Hope it is easier to read now. Can you help? (by epd5030)
best design to items system
 
hello everybody! i was moving forward on my little RPG, and came across the item system problem. up to now, i'm able to load an item list from an external fi...
[4 replies] Last: it's ok, i'm not attached to the idea of having a single vector to hol... (by Stauricus)
by Rukky1
pointer
 
Hi,i am new to c++ and have gone through pointers.i have understood the following code up to where it says p1 = &firstvalue and p2 = &secondvalue.But i am a kin...
[2 replies] Last: oh! thanks for that correction (by Rukky1)
by hadz
computing the amount to be paid
 
Write a program to compute for the amount to be paid by the customer in purchasing items. the program will accept as inputs the price of the items and how many ...
[2 replies] Last: I think I had create this program before. (by systemerror)
by zigzak
Which IDE!
 
Propose to c + + ide! (Outside of Visual Studio)
[9 replies] Last: I use Code::Blocks (by systemerror)
how to have 2 or 1 if known 1,2524...
 
if known 1 number real, how to have number integer minizise that bigger or smaller EX: real : 1,421 ->bigger is 2 and smaller is 1 real : 2,6343 ->bigger is 3 a...
[4 replies] Last: In c++ use the functions floor() and ceil() . http://www.cplusplus.... (by Chervil)
Any difference between !a and a==0?
 
Any difference between !a and a==0? !a a==0 seems to have the same result.
[6 replies] Last: Both expressions are equivalent if a is an integer or a boolean.... (by Peter87)
Digits To A Number
 
Hey! I'm trying to convert digits separated from each other in a vector into a number, for example if I have 1, 3, and 9 in a vector I want to turn that into th...
[8 replies] Last: Thanks for the answers everyone! I think I got it working now, however... (by GoranGaming)
seg fault in array of structs
 
I get a seg fault after I enter the Years of Employment. Could anyone tell me why? thanks a lot in advance #include <stdio.h> #include <stdlib.h> #def...
[2 replies] Last: Hi, The issue is due to the improper usage of calloc function.Actually... (by GobiSakthivel)
by ApoC
Hello World Problem
 
Hello, I'm learning via the book Accelerated C. there's an example that says that I need to write the following code: #include <iostream> int main() { ...
[8 replies] Last: > it just shows up a window and goes out right away, what should I do... (by JLBorges)
by coolve
Undefined reference??
 
Hi I'm slightly new with programming and I'm getting an undefined error. I have a main.cpp source file, and soldier.h header file, and a soldier.cpp source fil...
[3 replies] Last: I have no idea what happened but I just recreated the files and pasted... (by coolve)
July 2013 Pages: 1... 1617181920... 53
  Archived months: [jun2013] [aug2013]

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