General C++ Programming - October 2012 (Page 22)

by ekorad
How to check what is the last char of a string? (1,2)
 
How do i check wether (lets say, string end) end is the last character of a string? Is it: if (end = string.npos) ?
[24 replies] Last: [quote=cire]Apparently what you're reading and what I'm reading aren't... (by cire)
Monthly Payment
 
// Reaper #include <iostream> #include <math.h> using namespace std; int main() { float L , monthly , interest , amount , annual , monthlyrate;...
[11 replies] Last: I am try to be fair dinkum (truthful, constructive) about this comment... (by TheIdeasMan)
Learning C++ 15 years later, Pls help.
 
I did some c++ programming on my HND years ago, I have just found an old program I wrote that Displays an image then a menu with choices. I have a few question...
[5 replies] Last: [quote=andyedtec]I need to forget about all my old programs and start ... (by Chervil)
newbie Q on code::block
 
i m new to this, planning on using code::block/c++/gtkmm to develop apps to run on both windows & linux. i installed code::block/c++ bundled, n then installed ...
[no replies]
by Numeri
Char Output Color
 
I have been trying to output characters in the console in colors other than the sixteen default colors that SetConsoleTextAttribute( hstdout, 0xa ); will l...
[3 replies] Last: You are limited to 16 distinct colors at any one time, but you can act... (by Duthomhas)
by mala9
header file for vector string in vc++2010
 
i have to read and write a text file. here is code. please help where i went wrong. #include "stdafx.h" #include <iostream> #include <vector> #inclu...
[1 reply] : warning message saying that. Saying what? Some compiler have problem... (by coder777)
by Yezman
Deference Operator
 
So I have been looking around here http://www.cplusplus.com/doc/tutorial/pointers/ Notably this statement "Using a pointer we can directly access the value s...
[4 replies] Last: With due deference to the OP, the word in this context is dereference ... (by Chervil)
Please help me with my homework?
 
I have a horrible professor and he gave us this assignment and I absolutely can't do it it's more difficult than the others. 1) Write the definition of t...
[3 replies] Last: So far, so good. There's a small catch though (I'll let the code do th... (by Catfish2)
assignment - Alphabetical Order - Char
 
I have a program that gets first names from the user they are stored as char. We have to then determine of the names entered which name would come first and ...
[1 reply] : I have a program that gets first names from the user they are stored ... (by coder777)
Looping problem
 
int main(){//Declare an constant array of pointer to 6 Shipping Container Object const int TOTAL_CONTAINERS = 6; ShippingContainer *sc ; string theConte...
[9 replies] Last: my concept correct already? Nope, your second attempt comes closer to... (by coder777)
Visual Assist X
 
Hey guys, i have installed Visual Assist X and i am very excited about it. But i got one question about the settings. At the moment i have do do the setti...
[no replies]
by mono
class & struct....Questions
 
That is my class definition, but I am not sure how I am going to access the item of the struct (PriorityQueue::Item data) also how I am going to fill it out. ...
[3 replies] Last: TheIdeasMan wrote: You need to create an object in main of type Pri... (by TheIdeasMan)
by SMA01
Call a function within a function?
 
I'm writing a program to validate credit card numbers. I call three high level functions in the main. One of my functions (isValid) validates the arithmetic of ...
[2 replies] Last: Thanks, that clarifies thing. I declared it before the main function w... (by SMA01)
by db1447
recursive binary search problems
 
hey, Im new to the forum. I have a program holding a vector of structs and i am trying to search for a certain element of the vector based off a member of the s...
[no replies]
simple std::queue question
 
Hello all, In the following code I have tested the amount of ram the program consumes, and I realized that when the second loop was executed, the memory is no...
[3 replies] Last: Beyond a buggy implementation, I don't see anything that could be caus... (by helios)
by ob87
string
 
#include <iostream> #include <string> using namespace std; void main( ){ string first, last, full; cout << "Enter your first name: "; cin >> ...
[3 replies] Last: thanks i solved the problem (by ob87)
trying to calculate average in function with pointer notation. Keeps displaying memory address..
 
Hi, I was trying to calculate an average, and return the value using pointers in the function. Instead, it keeps returning the memory address. If anyone coul...
[10 replies] Last: Vlad, I really appreciate it, but i'm lost in space now. (by newB c PlusPlusGuy)
Quick sort an array with large number of elements Terminated
 
Hi all, I have not used C++ for a very long time. Recently I wrote a quick sort code with random pivot, and I wanted to calculate the time needed to run the ...
[no replies]
Searching class array for a specific word
 
It fails to search the file. I cannot pinpoint the problem. Here is the code for reference: int main() { Element e ; int num_elements; num...
[4 replies] Last: But its the loadElements function that is giving me trouble. It just ... (by cire)
Adding arrays without messing with the main program?
 
I did the program but my teacher says i need to make a array in this program without messing with "int main" part expect for changing few variables in there, mo...
[1 reply] : bump. (by EternalTactician)
October 2012 Pages: 1... 2021222324... 50
  Archived months: [sep2012] [nov2012]

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