Beginners - July 2009

array to a function causes strange errors
 
hi, I have an array int p ; then I pass the value of this array to a function i defined, func(int *point) in the function, I don't have any sentence to chang...
[1 reply] : int p has valid indices 0...9. sounds like you are attempting t... (by jsmith)
Integrating a 2-dimensional function
 
I have the following class, which will integrate a 1-dimensional function and need to figure out how to change it to integrate a 2-dimensional function. cl...
[1 reply] : First please put your code in [cod e][/code ] tags. Second, are numer... (by smilodon)
by BigRed
Array and File I/O
 
Hello all!! Im a newbie when it comes to C++ and I am constructing a program that, a. reads a file called weatherdata.txt, that contains the type of weather...
[1 reply] : Note, if you want help with this, please make your code more readable.... (by smilodon)
'myAccount' : undeclared identifier?
 
How I would I define myAccount usefully here? I thought I already did... #include <iostream> #include <fstream> #include <string> using namespace std...
[1 reply] : You've declared myAccount as a variable local to main() only. If you ... (by jsmith)
Delaying time stopping the program
 
I'm working on this LED matrix, but first I decided to write my program for TShape shapes. I'll cahnge their colours and imitate LED switching on and off. The p...
[5 replies] Last: It WILL make your buttons accessible. The buttons are also controlled... (by webJose)
Prime number function
 
#include <iostream> #include <math.h> #include <conio.h> #include <time.h> #include <stdlib.h> using namespace std; void wait ( int seconds ) { c...
[9 replies] Last: Nvm, I figured it out, it was supposed to be: while ([i<= sqrt(static_... (by vishant)
Averaging arrays question!
 
I have written a code but can not seem to crack how to average the array with only the slots entered in the running program. as it is right know it is dividing...
[2 replies] Last: Well, it seems to me that you have two options: Use lgrade, or loop l... (by webJose)
How do I avoid LNK1169 linker error when defining a function in a header file?
 
Hello everyone. I have a question that will probably expose me as the newbie that I am, but hey!, everybody is at some point in time. :) My scenario: I...
[no replies]
by mywan
Switch optimization and the 'or' operator.
 
Just started teaching myself C++ about 3 days ago, but have my goals well defined. My question concerns switch optimization and jump tables. Given a switch with...
[3 replies] Last: It depends upon the compiler, but in general, no. (by Duthomhas)
by MiaZas
identifying pairs in vectors
 
Ok, I have a deck of 52 cards stored in a vector named V of strings as V[?]=2D for 2 of Diamonds and V[?]=14S for ace of spades, etc... They have been shuffled ...
[7 replies] Last: And then vector< Card > deck; (by jsmith)
by MiaZas
string vectors
 
I have two vectors, one is full of numbers and the other with suits (a deck of cards if they are put together). After I print out the first five elements of eac...
[1 reply] : See your thread on the inventory vector for my answer. (by smilodon)
C-Strings and Pointers
 
I have this problem for an assignment and im lost on how to start. What really gets me are the two pointers - referencing them to the address of the last charac...
[2 replies] Last: And for pointers...they are useful for dynamically creating objects/me... (by firedraco)
Initializing an Array of a Class?
 
Hello everyone. I've been doing C++ for about a year and ahalf now, but I'm still struggling (such a learning curve!). I managed to narrow down a particularly n...
[7 replies] Last: Suppose you have three files main.cpp foo.h foo.cpp ... (by Duthomhas)
Simple C++ problem using loops
 
Hello. I'm very new to C++ and can't seem to figure out a seemingly simple problem. Using only loops (for, while, do while, etc.) I need to take user inputted n...
[3 replies] Last: You don't need much more than a loop to display a string in a reverse ... (by Bazzy)
File Input
 
Given an input file of sentances, how do you return the first word of every sentance? Example input file: This is the story of a cat and a dog who we...
[11 replies] Last: teacher won't let us use methods we haven't covered in class yet.. ... (by kempofighter)
Error....
 
I get this error : I:\manas\Lib Mang\Makefile.win [Build Error] No rule to make target `"Class', needed by `"Library'. Stop. what does it mean?
[1 reply] : Your makefile is wrong. (by jsmith)
by zero0
vector
 
I want to make a code about vector. The program will ask vector and it will output its distance from the first vector to the second vector and its unit vector
[4 replies] Last: For this you would probably want to use valarray. But I don't underst... (by smilodon)
by duleto
I got a little problem
 
#include <iostream> #include <string> #include <functional> using std::cout; using std::endl; using std::string; class Person { public: Person(string f...
[1 reply] : What's the name of your file. How do you compile it? (by kbw)
by varsha
linked list and string
 
plase tel me how to strore the characters of a string in a linked list using C and not C++..
[1 reply] : Please don't post in multiple forums. (by kbw)
Exception Specifications
 
Hi, I'm pretty new to C++ and to cpp as well. While studying exceptions , I ran into the exception specifications section, and to be honest I can't see a reaso...
[3 replies] Last: Exception specifications provide no benefit to your program, but they ... (by jsmith)
July 2009 Pages: 123... 20
  Archived months: [jun2009] [aug2009]

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