Beginners - October 2008 (Page 17)

by erico
My program outputs the wrong figures
 
I wrote a code that reads from a file, "fines.dat", then supposed to output the total fines but then it gives a wrong value. Here's the file: KAB 245K 8...
[1 reply] : I think I found where the problem was. Sorry if I bothered you. Here's... (by erico)
by ddk
How to terminate a program from a function?
 
Does C/C++ support terminating a program from a subroutine function i.e not main? So far I only found that exit and abort allow a user to terminate current fun...
[9 replies] Last: Yes, I was indeed in a bad mood yesterday. I appologize for anything b... (by exception)
by Hazer
Making something important
 
Hi! I'm learning c++ more than 3 months. I'm learning making examples like: please enter a number...its double and factorial is... Please write a sentence.....
[6 replies] Last: Hehe, actually real Game Development has TONS to do with programming. ... (by cheif)
by azimul
comparing two words
 
I have another assignment in which it asks for two words and then compare them to write the first one and then the other. I think I have solved the first one bu...
[7 replies] Last: If it's just two words. You can do something like this. Real simple. B... (by LacViet)
Creating a basic game, and failing!
 
I cannot seem to make my spike move! can you point out what I am doing wrong? #include <cstdlib> #include <ctime> using namespace std; #include "SD...
[3 replies] Last: ok kinda figured it out, #include <cstdlib> #include <ctime> ... (by spy4hearts)
by sparky
Hiding Implementation Details
 
I keep getting the following linker errors whenever I try to hide the implementation details of my class. Any assistence will be greatly appreciated: Linker...
[8 replies] Last: Thank you very much everyone: I was creating the project incorrectly. ... (by sparky)
by bauerb
basic C++ question, real newbie here
 
sorry for the post but my team is doing an internet scavenger hunt. part of it is a C++ quiz. need help with the following questions, Help ! Consider this C...
[no replies]
by azimul
alpha and numeric characters
 
I have an assignment that asks the user to input a sequence of 10 characters that must be alphabetic and numeric combined. Store the sentence in a cstring varia...
[1 reply] : If you are using a string, you can use stringstreams to look at each c... (by firedraco)
using directories
 
how do u use directories in c++ ive tried using opendir and after downloading the required .h files all i got was alot of errors. so how would I use directorie...
[no replies]
assertions?
 
Hi When I try to add something to my vector VC++ gives me an assertion error Debug Assertion Failed! Program:...strategy\Debug\strategy.exe File:c\Progra...
[2 replies] Last: Now if we look at the code for the vector include file - round by lin... (by guestgulkan)
C++ testing
 
I am looking for a good guide for C++ test classes. I am still searching on Google and still cannot find anything too helpful. Does anyone know a good guide?
[1 reply] : Google Unit Tests. Then pick a good library. The theory is the same ac... (by Zaita)
A quick question about const objects
 
If I pass a const object to a function by reference, is it true that I cannot "use" any of its member functions? If so, why?
[2 replies] Last: Ah, makes sense. Thank you. (by Poke386)
by azimul
how could i get the length of my name
 
I have an assiganment which ask for sentence and the length of the sentecne, i write out program but i could not get the lenght of the sentence. the program is ...
[2 replies] Last: thank you so much LacViet, I have another two questions can you help m... (by azimul)
About Inline Functions
 
When they are better than the normal ones?
[5 replies] Last: First off, function aliasing is a major part of the whole 'object-ori... (by exception)
string manipulation functions?
 
Hi. I've written a program for a beginner C++ class that asks the user to enter a generic five-word phrase (with a single space between). It then outputs each...
[3 replies] Last: The getline() function reads a line, not just a word. So by saying get... (by Mitsakos)
by wehs
Pointer vs Table for strncpy
 
Hi I'm using Visual C++ 2005. Why code below works: char text1 = "aaaaaa"; char text2 = "bbbbb"; printf("%s\n", strncpy(text1,text2,5)); w...
[3 replies] Last: Thanks for all replies. Now I understand. W. (by wehs)
Classes problem defined symbols found already defined
 
Hello guys. I started programming in C++ a week ago so I barely know anything :( and i ran into a problem that broke my whole project I was trying to do.. and ...
[7 replies] Last: #include <windows.h> #include <stdio.h> #include <stdlib.h> #includ... (by spyk311)
by Zosden
Vector of structs
 
Hey I'm pretty new to C++ but have quite a bit of experience in Java. I have a project to make a Morse code translator. I have a struct that holds a letter and ...
[no replies]
strcmp and strcpy error
 
hi, I have 3 std::string and I try to use strcmp and strcpy. but for both of them I've got this error " cannot convert parameter 1 from 'std::string' to 'const ...
[4 replies] Last: To use them, you would: strcmp(str.c_str(), str2.c_str); (by QWERTYman)
reading from file
 
hi, I save a string value to a file, Now I want use this value again, but null return save function int save_pass(void) { /* function variables */...
[no replies]
October 2008 Pages: 1... 151617181920
  Archived months: [sep2008] [nov2008]

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