Forum: C++ 13 Days Ago |
| Replies: 2 Views: 207 It's no harder to write C/C++ code in Linux than it is in Windows. In fact, I'd argue that for basic programming Linux is actually easier. You'll need a few things to get started. Open up whatever... |
Forum: C++ 22 Days Ago |
| Replies: 8 Views: 331 Did you read the question? He's asking for how to get the length of an integer array, not a string.:P strlen(MyIntArray) is just so not going to do what the poster wants. |
Forum: C++ 22 Days Ago |
| Replies: 8 Views: 331 Correct me if I'm wrong, but length() works for strings not integer arrays. If it does work then please demonstrate how, because I got a syntax error trying it.
Here's some code that I know works.... |
Forum: C++ 23 Days Ago |
| Replies: 5 Views: 315 You have one of a few choices:
1. Convert your function from returning an int to returning a string
2. Convert MyName to an integer.... maybe something like MyID
3. Convert your function to... |
Forum: C++ 25 Days Ago |
| Replies: 4 Views: 151 Also, 1 more thing. When you print a double like 2.00 you'll get the output 2. So what you want to do is:
cout << fixed << setprecision(2);
This set's the precision of output to 2 decimal... |
Forum: C++ 25 Days Ago |
| Replies: 4 Views: 151 Actually you declared total as in integer and you're using it to store the total price. So, it's not printing any decimals because integers don't have any decimal points in them. |
Forum: C++ 27 Days Ago |
| Replies: 3 Views: 150 Thanks for the explanation. Much appreciated. |
Forum: C++ 27 Days Ago |
| Replies: 3 Views: 150 My C++ course hasn't covered a topic yet, but I'm expected to solve a few problems with this material. I've got some working code I just don't fully understand it. Can someone help me, please?
... |
Forum: C++ 28 Days Ago |
| Replies: 2 Views: 151 Who says you can't because my C++ book says you can and my test program works fine too.
#include <iostream>
#include <cstdlib>
using namespace std;
class MyObject
{ |
Forum: C++ 29 Days Ago |
| Replies: 5 Views: 237 You had several problems with your code. I got it to compile though.
A) void main() ... in C++ it's ALWAYS int main()
B) Check your opening & closing braces {}, that's where your mistake is.... |
Forum: Windows NT / 2000 / XP 30 Days Ago |
| Replies: 8 Views: 429 I had no idea. Moderators, feel free to delete my post. I guess I'm a little too trusting of people. Sorry, if I broke any forum regulations. It wasn't my intention. |
Forum: Windows NT / 2000 / XP 30 Days Ago |
| Replies: 8 Views: 429 Do have have access to an admin account? As in any admin account? If so you can reset the password without knowing the old one via net user command.
net user administrator * |
Forum: C++ 30 Days Ago |
| Replies: 5 Views: 237 I got this to compile just fine by declaring the variables that I mentioned above. |
Forum: C++ 30 Days Ago |
| Replies: 5 Views: 237 For one, i & j aren't declared, unless they are global variables.... but my C++ teacher would kill you for doing that. Take a look yourself:
for (i=0;i<3;++i)
{
for(j=0;j<3;++j)
... |
Forum: C++ 31 Days Ago |
| Replies: 3 Views: 182 Also, this is wrong:
cout<<"Numbers entered: "<< numEntered<<endl; //output 10 inputed numbers
numEntered will only be the last number that you entered. Your array is where you are storing 10... |
Forum: C++ 31 Days Ago |
| Replies: 3 Views: 182 cin >> numEntered; //Ask for a number
//This part is fine, you get a number from the user
numEntered = number[i]; //oops, it's backwards
... |
Forum: C++ 33 Days Ago |
| Replies: 4 Views: 365 #include <sstream>
stringstream toString;
int num = 55; //Your integer
string stringNum; //Your output
toString << num;
stringNum = toString->str();
toString->str(""); //Clear toString so... |
Forum: C++ 34 Days Ago |
| Replies: 9 Views: 441 I temporarily removed the stringstream variable and the function that depends on it. It compiles great now. Problem solved.
Thanks for the replies. |
Forum: C++ 34 Days Ago |
| Replies: 9 Views: 441 Thanks, I haven't learned about copy semantics yet so I had no idea. I'm using that variable to convert some integers to strings so I will need it in the object, but I'm sure that now I can get it... |
Forum: C++ 34 Days Ago |
| Replies: 9 Views: 441 #ifndef CLIENT_H
#define CLIENT_H
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
class Client
{ |
Forum: C++ 34 Days Ago |
| Replies: 9 Views: 441 In any case, I can create individual clients I just can't push them onto a vector without causing a compile time error. I have no idea what I'm doing wrong. |
Forum: C++ 34 Days Ago |
| Replies: 9 Views: 441 Compile time error...
manager.cpp: In copy constructor `std::basic_ios<char, std::char_traits<char> >::basic_ios(const std::basic_ios<char, std::char_traits<char> >&)':... |
Forum: C++ 34 Days Ago |
| Replies: 2 Views: 202 According to Bruce Eckel the performance difference between C++ and C is usually less than +/-10%. He also noted that a well designed C++ program can be "more efficient than the C counterpart"....... |
Forum: C++ 34 Days Ago |
| Replies: 1 Views: 109 I'm lazy so I'll copy and paste from "Beginning Visual C++ 2005" (I have the pdf)
When you create a new project workspace, Visual C++ 2005 automatically creates configurations for pro-
ducing two... |
Forum: C++ 34 Days Ago |
| Replies: 9 Views: 441 If I have 2 classes
a) class Business
b) class Customer
I want the Business class to be able to store a dynamic list of it's customers. So I thought the easiest way to do this would be to use... |
Forum: C++ Oct 21st, 2009 |
| Replies: 4 Views: 229 LMAO, I love it. It's humorous and it gives the correct answer to the question.
To add some more insight into the answer I would put the vowels into a container like an array or vector. Then just... |
Forum: C++ Oct 21st, 2009 |
| Replies: 4 Views: 229 |
Forum: C++ Oct 20th, 2009 |
| Replies: 5 Views: 220 This one works, not super elegant, but it works. You'll have to eliminate your marker if you want.
#include <iostream>
#include <iomanip>
#include <string>
#include <stdio.h>
using... |
Forum: C++ Oct 20th, 2009 |
| Replies: 5 Views: 220 Method 1 is to use a "middle" variable.
#include <iostream>
#include <iomanip>
#include <string>
#include <stdio.h>
using namespace std; |
Forum: C++ Oct 19th, 2009 |
| Replies: 5 Views: 220 If I understand you correctly then you want to remove the spaces in a string in two passes. In one pass you remove the spaces from the left half of the string and then in the second pass you remove... |
Forum: C++ Oct 16th, 2009 |
| Replies: 9 Views: 381 I can't think of any really simple way to do this. I suppose you could use something like a struct or a union. This way you could store more than one type of variable depending on what you need. I... |
Forum: C++ Oct 15th, 2009 |
| Replies: 13 Views: 383 Your teacher doesn't care, but maybe you should. You got someone else to do for homework for you. Congratulations, you missed out on the chance to learn something from your own effort. Now what... |
Forum: Apple Hardware Oct 14th, 2009 |
| Replies: 10 Views: 4,164 "Much to my disappointment, though, my built-in Broadcom wireless network adapter wasn't supported by default."
What you're saying is that you had to install the driver. OK... big deal? What I... |
Forum: Linux Servers and Apache Oct 14th, 2009 |
| Replies: 17 Views: 32,252 "gNewSense contains only free software. It's also the distro that Stallman himself uses--how can you beat that?"
Those are two good reasons not to use it. Until free software works on my hardware... |
Forum: C++ Oct 14th, 2009 |
| Replies: 13 Views: 383 You said: "Help Me With this please...I'm just learning C++", but you didn't say what you want help with. Where are you stuck?
Check for even numbers: variable % 2 == 0
Chick for highest... |
Forum: C++ Oct 13th, 2009 |
| Replies: 3 Views: 158 iostream allows you to use cout, cin, etc.
cstdlib allows you to use system(), exit(), EXIT_SUCCESS, etc.
Basically, when you use the #include statement you are adding the ability to use... |
Forum: C Oct 13th, 2009 |
| Replies: 3 Views: 264 Looks like pdcurses need to be copied somewhere into the mingw directory. If you look at this page:
http://www.mingw.org/wiki/LibraryPathHOWTO
it should give you more information. In any case,... |
Forum: C Oct 13th, 2009 |
| Replies: 1 Views: 186 The program is using something called binary shifting. For example:
1 << 1
one is binary "001" shifted by one equals binary 010, aka 2.
1 << 2
Binary 001 shifted by two is binary 100,... |
Forum: C Oct 12th, 2009 |
| Replies: 3 Views: 264 Google is your friend. Apparently ncurses is available in Mingw as a user contributed library/package called pdcurses. You can get it....
... |
Forum: C Oct 12th, 2009 |
| Replies: 1 Views: 171 Why don't you write it out in English and then translate it into C? Just write down what you see in each row, 1 row at a time.
If it's row 1 or row 2 then the color is blue
..
if it's row 3 and... |