Beginners - October 2011 (Page 50)

Functions in a Header File
 
Hello, How would you write functions in a header file, and then call it to your main.cpp. Can someone please give me an example. -Code Assassin
[4 replies] Last: Nvm, I solved my problem. :) (by Code Assassin)
by bpx95
Is Calling Functions Slow?
 
I have a little code here that I am very confused by. All of this is inside a class, which is declared in a header file. This code is inside a loop, which iter...
[2 replies] Last: Ooooh. Ok. I have no issue with not using the function, I was just cur... (by bpx95)
by kw1991
Can't get loop working
 
i have a text file with 30 records in it with 4 people listed. A person will be in the text file many times with a different date beside the name each time ...
[18 replies] Last: @ Nisheets: My fault. Thank you! (by S G H)
by Rainie
Reading a text file & doing mathematical operations with it's contents
 
Among my c++ manual exercices, there is one that asks me to open a text file, read it's contents which look like this: 2.776667 7.34532 3.00463 1.95678 -...
[no replies]
Holding the program open
 
I've got the majority of the code down, I' am just running into the issue of the program window not staying open after I press enter to continue. #include <...
[7 replies] Last: [quote=Gaminic]Your main isn't returning a value. (sic) The compiler ... (by closed account zb0S216C)
Need guidance
 
Hello, I am currently doing a project in my class. The project has us creating a function that takes an input file and asks the user for a maxwidth. Basicall...
[3 replies] Last: I would suggest std::vector for such a job. the std::vector expand... (by closed account zb0S216C)
by vlad61
switch statement bug
 
hey guys, this code is copied almost exactly from Bjarnes Stroustrups book and i cannot find the bug thats making me have to tel it to quit twice for some reaso...
[1 reply] : Try removing std::cin>>op (sic) from the condition and use std::cin... (by closed account zb0S216C)
Else Statements
 
int Level_diff_chck(){ if (level_diff == 1) { Nacht_der_Toten_SndBox(); } else if (level_diff == 2); { Nacht_der_Toten_Intr(); } else (level_diff == 3); { ...
[2 replies] Last: Thanks. (by Code Assassin)
Counting the number of times a source file is called
 
The title pretty much explains it, I'm trying to count how many times a looped "while" statement calls on a certain source file. Currently the program grabs ...
[4 replies] Last: How many times per student or total? What you've got there already doe... (by Duthomhas)
visual studio linkers + direct x error
 
hi Where do I find "project properties"? since it isn't present under the options in visual studio 2010 (or that I'm finding it hard to find). Project pr...
[1 reply] : Where do I find "project properties"? Right click your project (in t... (by shacktar)
sorting 4 integers in ascending order
 
I am suppose to write a program to read in 4 integers and then sort them without using arrays or loops. I have no idea where to start, this is an intro class. ...
[9 replies] Last: Maybe something like: if(a<b)swap(a,b);// you write the swap functio... (by closed account D80DSL3A)
Hey ..could u plz check wts wrong with my program
 
im studying data structuer using c++ in my 1st year i wrote a c++ programme using class called vector for hangling n-dimrnsional vector.. but i had errors wh...
[7 replies] Last: ohh ..now i understand that one ..merci eric :) (by eng soso)
compare celsius degree to fahranhite
 
Hi everyone, i was asked to convert celsius degree temp in a range of 0-100 in increment of 5 degree celsius to the equivelant fahrenhite temp and diplay them...
[6 replies] Last: oh ya, that make sence. thank you very much (by panther)
a quick question about a header file
 
I came across a header file which is named "TestSuperMatrix.h" . This header reads #ifndef CPP_UNIT_TESTSUPERMATRIX_H #define CPP_UNIT_TESTSUPERMATRIX_H #...
[5 replies] Last: I see. Thank you! (by subjugater)
filling an array via another function
 
I can fill a value via two functions as below, but how can I fill more values (like an array)? I need the most efficient way, thanks for helping. void funct...
[1 reply] : I did this but I need a more elegant way to do the same thing (I do no... (by delicevat)
Where to start with this question?
 
Hello, I'm new to the forum and currently taking my first C++ course. We're using Programming: Principles and Practice Using C++ and I'm having trouble with Cha...
[6 replies] Last: So I figured it out (I think) and here's my code: int main() { ... (by Trashcan42)
Emacs errors with code that works in IDE's
 
Just starting with programming and I'd like to use Emacs (on Linux), the reason for this is that I'm reasonably familiar with Emacs as a text editor and I'm com...
[1 reply] : Did you use gcc instead of g++? Tsk. ;D -Albatross (by Albatross)
by kw1991
having trouble displaying the program
 
i have a text file with a list of numbers and dates and i want to find the smallest (the numbers are not in order) and display the date heres what i have so ...
[5 replies] Last: it works thanks (by kw1991)
Help, trying to do a school project
 
Ok so I have this assignment that I have to do and this is what it says... Write a program that will ask the user for two integer numbers. Use a for loop to...
[8 replies] Last: oh hahah simple mistake. I meant to take that out and forgot. And actu... (by Americo)
C++ can't catch exception!!
 
I complied the code piece below successfully via VC++ 2010 but when I run the exe file ,I found there is an unhandled exception. But I have my try catch block...
[2 replies] Last: Most likely, the exception is not a C++ one, probably an access viola... (by greenoaktree)
October 2011 Pages: 1... 4849505152... 59
  Archived months: [sep2011] [nov2011]

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