Beginners - February 2011 (Page 17)

by Smitty
Need Program Coding Advice.
 
This is the code I have so far. I haven't been successful when try to finish/fix it. I have included what I have so far. Can anyone help me out? /*********...
[2 replies] Last: All you needed to do was do some Control Statements and update your va... (by CDiebold)
by pooshi
Print out a vector
 
Hello. I have a function that excepts a vector of structs and I want to use an iterator and a cout statement to print the vector to the screen. Visual Studio is...
[4 replies] Last: Thanks m4ster r0shi for the help. I got it! (by pooshi)
Hotkeys for Console Applications
 
Is it possible to make my console application detect if I press a C key when the window is focused? I want to do almost the same concept of key logging but I wo...
[3 replies] Last: If I understand you correctly, you'd like to do something like create ... (by Duthomhas)
by masta
Whats wrong with my code?
 
Whats wrong with my code? #include <iostream> using namespace std; int main () { cout << "Hello World!"; return 0; } I keep on getting two err...
[4 replies] Last: Thanks Grey Wolf :) (by masta)
by Crippy
Declaring a Constructor
 
Hello There! I'm working on a histogram class, but something seems to be wrong with the constructor I'm using... here's the code: class histo { ...
[19 replies] Last: I made two changes to the code posted at 9:42 (added #endif to the end... (by Moschops)
by Gldnbr
Linked List
 
I'm getting really stressed out, creating a sorted linked list is very difficult and I'm trying the best I can, I'm just writing this code as I go and I don't e...
[1 reply] : Those numbers on the right are the line numbers where the errors are. ... (by Moschops)
Passing dynamic array into a function
 
Hello, I am a complete noob in c++ and I am trying to work out this problem: I need to get the user to input the number of elements of a dynamically allocate...
[6 replies] Last: #include <iostream> using namespace std; double avg(double *r, in... (by Moschops)
segmentation fault
 
hi guys, i am new to c++ and unix. I have my code written and it can be compile successfully. Not sure where the problem is (I checked the pointer part, it s...
[2 replies] Last: score = atof (tokens[i+1].c_str()); // convert each score in string ... (by coder777)
++?
 
What does "++" mean? I have seen it used in the responses to some of my questions, and some questions by other people. I know that to manually debug a pr...
[8 replies] Last: [quote=richgirl]can v=v+2 written as v=+2? No. writing this v=+2 the... (by coder777)
Queue of objects
 
Hello all, I am trying to create a queue with a maximum of 10 instances that will store an object containing a string and integer. My program structure so...
[8 replies] Last: yes, anything that doesn't initialize itself should be initialized exp... (by coder777)
by TNT
How can I fix this problem?
 
#include <cstdio> int add(int a, int b); int main() { int a, b, c; printf("Enter a numerator: "); scanf("%d", &a); printf("Enter a deno...
[4 replies] Last: [quote=TNT]I'm still getting 0 after changing return a/(float)b; add r... (by coder777)
Convert hex from a text to decimal
 
Hello, I have a text file that contains lines that look like this: FDB $01F0 I want to take the first three numbers after the "$" and convert the...
[15 replies] Last: And if the number of characters before the dollar sign varied? And if... (by rocketboy9000)
segmentation fault at firstlist.show_list();
 
any idea whats wrong? i'm stumped. #ifndef LISTS_H #define LISTS_H #include <iostream> #include <cstddef> using namespace std; class Lists { int...
[1 reply] : Here's a couple ideas: #ifndef LISTS_H #define LISTS_H #include ... (by moorecm)
by Gldnbr
Sample Sorted Linked List?
 
Is there anyone that can give me a simple example of a sorted linked list in c++? I'm currently taking a CIS course on pointers and sorting lists and we have t...
[2 replies] Last: Sample linked list for visual learners: +---+ +---+ +---+ |... (by moorecm)
Shuffle a Char Array
 
All, I'm having trouble trying to find a way to sort a char array, i've created the array as per below: ColourArray = "orange"; ColourArray = "green"; ...
[6 replies] Last: Thanks everyone, I'll take a look and try this approach. Much appre... (by NiceGuyChris)
Editing car loan calculator code
 
I am a beginner c++ student with an assignment to create a car loan calculator. I am having trouble with the calculations of the monthly payment, which I assume...
[6 replies] Last: Also note the preview button, so that you can play with it before post... (by moorecm)
What do this mean?
 
what does this error normally mean: /tmp/ccGtzp0M.o(.text+0x120): In function `main': : undefined reference to `stack<int>::stack()' collect2: ld returne...
[1 reply] : It means you implemented your stack<> template inside a .cpp instead o... (by jsmith)
why doesnt this work?
 
#ifndef CPP_TESTSTACK2 #define CPP_TESTSTACK2 #include <iomanip> #include <iostream> #include <typeinfo> #include <cstdlib> using namespace std; /...
[6 replies] Last: i made it just pass in a (type item) parameter but then when i compile... (by sorthon123)
RNG and time(NULL) vs time(0)
 
is there another/better way to generate random numbers aside from: srand(time(NULL)); x = rand(); that is comprehensible enough for a beginner? also...
[2 replies] Last: rand() doesn't generate random numbers. It generates PSEUDO-random num... (by Abramus)
by rever
Problem to see array values while debugging
 
Hi all! I have just moved from Java (Eclipse) to C++ (Visual Studio 2008) and one of the first differences I am seeing is that, when debugging, I am unable t...
[1 reply] : When you have an array Type arr ; you will be shown all 10 elements.... (by hamsterman)
February 2011 Pages: 1... 1516171819... 43
  Archived months: [jan2011] [mar2011]

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