General C++ Programming - February 2011 (Page 18)

by Icenel
How to define array length based on input
 
I have problem with array Input prime number, then input is n example input : 29 length array is n-1 then define array should be int primeNumber[n-1]; ad...
[1 reply] : http://www.cplusplus.com/forum/beginner/8473/#msg39179 (by kbw)
troubl with array and classes
 
this is for school and i have to create an array with five objects and assign 3 values to those objects, for example (1,10,11). and then print those values out....
[1 reply] : In what language (Im presuming c++?) Try creating a class with an a... (by joro550)
delete rest of a string
 
Hey folks, I'm having trouble with the switch case function lately. I want to compare a character from a string with a bunch of signs and after it found a...
[6 replies] Last: Ah written at the same time eh! Thanks Althar. I guess I would have... (by Dudovitz)
Matrix generation in C++
 
I have the following code: for (int w=0; w<10; w++) { //some lines of code unsigned long num = x.to_ulong(); cout << "Decimal form is: " <...
[1 reply] : Some questions, how does num change? or is the same all the time? u... (by CppSpartan)
I/O - Get Data on selected lines?
 
hi, I'm learning cpp for about 2 weeks now and I wanted to try my skills, so I started to create custom "console game", unfortunatelly, I know how to save data ...
[2 replies] Last: thanks, it works, but what about "stats" ? how can I set HP to int hp,... (by mekkatorqu)
Problem in Matrix Multiplication(Using freind function)
 
Hi folks, I'm a beginner in c++. The other day was trying to multiply 2 matrices using friend function. The program did run ,but the result showed some ga...
[2 replies] Last: In general multiply the row with col then adding the results. if your ... (by CppSpartan)
maximum, minimum and average of a matrix?
 
std::vector<std::vector<unsigned long> > matrix(15); // 15 rows typedef std::vector<std::vector<unsigned long> >::iterator it_type; it_type row = matrix.beg...
[1 reply] : just put an accumulator in there, and two if statements will take care... (by closed account zwA4jE8b)
Problem In Making a Grid Through Linked List?
 
Hi, i am making a program which will create grid through linked list.I had took four pointers up,down,left,right,and a data part.Through these pointers we will ...
[3 replies] Last: 1: Make sure that your code is in a format that helps , people to unde... (by CppSpartan)
Pointer code explaination
 
Hi all, I have the following code using pointer to remove duplicate letter from a user specified key and fill up the empty space with alphabets. Eg. key i...
[1 reply] : help please anyone? (by shanex88)
by Arvid0
Calling function from 'owner' class
 
Hello, I'm having trouble figuring out how to call a function from inside a class to a class which holds the object. It's a bit hard for me to explain, bec...
[11 replies] Last: I found the solution to my problem. jsmiths post hinted me that it had... (by Arvid0)
by DMDTT
Filling a vector with several objects of the same type
 
Hello guys, i've just registered and i hope to find a fast solution. my job is to read in a master data file of several persons. this data should be display...
[13 replies] Last: so and theres is the problem... i don't know exactly which language... (by DMDTT)
how can I get mysql comparisons to be case sensitive?
 
Using the C API, I have a VARCHAR column as my primary key in 2 of my tables and when I try to insert "TEST" and subsequently "Test", the second insertion fail...
[1 reply] : Check this: http://sql-info.de/mysql/gotchas.html#1_4 (by NickPaul)
by Neo7C7
C++ strings & string member functions
 
I have to get input from the console for a paragraph, and break the paragraph into sentences and then words. I'm trying to do this with the C++ string class....
[1 reply] : I would look into: string::find string::substr Run through the ... (by NickPaul)
by Icenel
How to define array length based on input
 
I have problem with array Input prime number, then input is n example input : 29 length array is n-1 then define array should be int primeNumber[n-1]; ad...
[1 reply] : You will have to use dynamically allocated memory. Have a read thr... (by NickPaul)
Ending a program
 
I do not want my end programs to end as "Press any key to continue" Is there another way for them to end like "Press 0 to exit" or "Press c to continue" ?
[7 replies] Last: Perhaps they don't have the "any key" ;-)? http://elcodigo.com/blog/w... (by onur)
How to use Pointer inside a Structure
 
I hav made a structure in my C program: typedef struct species { int Trophic; int Niche ; } species; So each species has a Trophic value and a Ni...
[7 replies] Last: Looks good to me! In C++ there are a number of programming practices w... (by NickPaul)
hey guys, problems with a program
 
i'm having a problem with a program intended to "crack passwords" but not really.. this will never be implemented, i just thought it'd be a cool project to get ...
[6 replies] Last: oh, i finally got this resolved. i had to add another if statement and... (by jteally)
by h9uest
Hiding in Inheritance
 
Fact zero: In C++, a function is identified with its function name and parameter list. (excluding return type) Fact one: Inheritance implies that the derived...
[10 replies] Last: cool, thanks man. I think I kind of understand the concept. (by closed account zwA4jE8b)
Sort an array of integers of size n in ascending order of values
 
I have no idea how to approach this problem, someone please give me a hint or head start. Write a program to sort an array of integers of size n in ascendi...
[1 reply] : look up bubble sort. most of the example you find will use a for loop... (by closed account zwA4jE8b)
Functions
 
Im supposed to design a program that simulates a vending machine that sells icecream. #include "stdafx.h" #include <iostream> #include <cstdlib> #include...
[6 replies] Last: Thanks! so i would probably be using the for statement. (by danielwow)
February 2011 Pages: 1... 1617181920... 25
  Archived months: [jan2011] [mar2011]

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