Posts
 
Reputation
Joined
Last Seen
Ranked #403
Strength to Increase Rep
+7
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
5
Posts with Upvotes
5
Upvoting Members
5
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
4 Commented Posts
0 Endorsements
Ranked #818
~48.8K People Reached
Favorite Forums
Member Avatar for Aild

2 things: first, arrays are declared like this: [CODE] int array[5]; int array2[] = {1, 2, 3, 4, 5}; [/CODE] not like this: [CODE] int[5] array; int[] array2 = {1, 2, 3, 4, 5}; [/CODE] secondly, when dealing with multidimensional arrays, unfortunately you can't do [CODE] int array[][] = {{1, …

Member Avatar for Andy_20
0
13K
Member Avatar for mattybennett

everyone gets heckled a bit from time to time, don't let it bother you. Now, per your request regarding the program. I will try to convince you that it is a bad idea for a beginner. 1st. 6month old babies don't learn to drive on the autobahn (take the analogy) …

Member Avatar for joel.queiroz
0
2K
Member Avatar for jesseb07

Hi, my mom has a Dell Dimension 4550 that has been running fairly smooth for several years. Recently she tried to install some new DDR ram in to the mobo, and VERY incorrectly seated it. She asked me to look at it (after the fact) cause her computer would power …

Member Avatar for Mark Lone
0
318
Member Avatar for jesseb07

hey, had a question that I couldn't figure out. I'm writing a program for linux and I need to save things to a person's Desktop. Because of that, I need to know their username. I am aware of the linux commands whoami, id, etc, but they only print the current …

Member Avatar for jbennet
0
8K
Member Avatar for atch

[QUOTE=Protuberance;944855]You have two same functions in class [code=cpp] class Object { protected: enum ID {OBJECT, CAVE, MONSTER, WUMPUS, HERO, GUN, BAT}; //maybe it better place outside the class? Coordinates* _my_coordinates; void id(ID id) //first declaration { this->_my_id = id; } public: explicit Object(s_int coordinate_x = 0, s_int coordinate_y = 0); …

Member Avatar for jesseb07
0
103
Member Avatar for mandofl

if I understand correctly, try adding this just before your return statement in "int main()" [CODE] cin.get(); [/CODE] that will wait for you to review the data and press enter before exiting the program. As it is now as soon as it's done with all of it's tasks, it closes …

Member Avatar for mandofl
0
4K
Member Avatar for sara9111

you will also need to define x, y, a, and first before you can use them in main()

Member Avatar for jesseb07
0
119
Member Avatar for renovat0

a couple things I see, first of all, please see the link in my signature for the rules regarding code tags etc, it makes it MUCH easier for us to help you if we can see your code in a comprehensible manner. Second, I don't think this would compile, so …

Member Avatar for jesseb07
0
95
Member Avatar for renovat0

your boolean logic is ill-formed inside of your if statements, instead of [CODE] if(a==R||r) //etc. [/CODE] it should be [CODE] if((a == R) || (a == r)) //etc. [/CODE] how your first logic reads is "if a equals R or if r". how I think you wanted your logic to …

Member Avatar for renovat0
0
106
Member Avatar for agaba

> When my try to rebuild my program i m getting this errors 1>Linking... 1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup 1>C:\Users\agaba\Documents\Visual Studio 2005\Projects\car\Debug\car.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://c:\Users\agaba\Documents\Visual Studio 2005\Projects\car\car\Debug\BuildLog.htm" 1>car - 2 error(s), 0 warning(s) …

Member Avatar for John A
0
145
Member Avatar for JackDurden

looks like there's a couple things, I don't think that would even compile: comparing a map<int, vector<int> >::iterator to an int inside your loop doesn't seem safe to me. As well as not declaring the map type for your iterator. anyway, see if this is a good starting point: [CODE=c++] …

Member Avatar for jesseb07
0
148
Member Avatar for lotrsimp12345

do you mean if you don't explicitly create a constructor in your class, or are you referring to constructor overloading? if it's that you don't explicitly create your own, here's what happens [CODE=c++] #include <iostream> //feel free to give this a test to see for yourself, it should compile ok …

Member Avatar for packrisamy
0
260
Member Avatar for ryBowk

I think I know what you're after, try having a variable to hold the totals for each value, something like this maybe: [CODE=c++] #include<iostream> using namespace std; int main() { double b = 2.88; double h = 2.4; double totalBoards = 0; double totalBags = 0; double w; int p …

Member Avatar for ryBowk
0
137
Member Avatar for Leniel

[QUOTE=Leniel;937357]WHAT 12 ? well 12 is suppose to be of the array for DOB[12]. What n? and the n is to save the crn [n] so that it can matched the DOB [12].[/QUOTE] well, that should give you several problems considering you declared DOB to be an array of size …

Member Avatar for Leniel
0
184
Member Avatar for vinnijain
Member Avatar for WaltP
0
79
Member Avatar for metalclunch

the syntax for a do-while loop is this: [CODE=c++] do { //stuff to loop through } while(conditions); //note the colon [/CODE] and maybe consider changing your 'switch' statement to a series of if-else since there's more than 1 or 2 lines of code for each option. I think that's more …

Member Avatar for 23.12.2012
0
237
Member Avatar for OwenRoberts

your problem is in how you are compiling it. You need to compile each .cpp file separately into objects and then link them all together at the end. Give this a try (my g++ flags are a bit rusty, but I think they're right) g++ -c time1.cpp -o time1.o //compile …

Member Avatar for jesseb07
0
380
Member Avatar for Cloneminds

[QUOTE=Cloneminds;914396]For some reason, my numbers aren't adding in correctly and it's taking the -1 sentinel value and adding it into the total. [code=C++] // worthless testing.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using std::cout; using std::cin; using std::endl; int main() { int …

Member Avatar for siddhant3s
0
120
Member Avatar for Cloneminds

global variables ARE a bad idea, which is why it's not the only way to accomplish this with a void function. Try passing things by reference: [CODE=c++] void getSales(double &sales); //try this instead //other functions int main() { //declare constant and variables const double RATE = .1; double sales = …

Member Avatar for wildgoose
0
224
Member Avatar for lotrsimp12345

give stringstreams a try for converting from string to integer: [url]http://www.cppreference.com/wiki/io/sstream/start[/url] [url]http://www.cplusplus.com/reference/iostream/stringstream/[/url]

Member Avatar for s_sridhar
0
327
Member Avatar for jesseb07

hello, got a quick question regarding stack overflow (I honestly don't know if this is more suited for a wxWidgets forum, once you see what I mean, but I figured I'd try here first). I was tweaking my linked list class and testing it in a testing harness program I …

Member Avatar for jesseb07
0
258
Member Avatar for sharkattack85

2 options for this problem: 1. Add [CODE]cin.get();[/CODE] just before your return. This waits for user input before exiting the program. 2. Run the program manually from a terminal. Then you can see the output even if the program exits ~J

Member Avatar for siddhant3s
0
242
Member Avatar for Stefano Mtangoo

I personally generally use an EVENT_TABLE if I have a large number of events for a class ( > 5 or so), but if I only have 1 or 2 I generally use Connect (or I have a complicated gui, lots of enabling/disabling etc). I've just found it to look …

Member Avatar for Stefano Mtangoo
0
255
Member Avatar for youngfii

an alternative to the explicit initiation, is you could change your while loop to a do-while: [CODE=cplusplus] #include <iostream> #include <ctime> using namespace std; int main() { int random; int guess; srand(static_cast<unsigned int>(time(0))); random = rand()%7+1; std::cout << "Guess my number! (1-7)\n"; do { std::cin >> guess; std::cin.ignore(); if (guess …

Member Avatar for jesseb07
0
112
Member Avatar for fadia

[QUOTE=fadia;879121] [CODE] for(int i=1;i>=10;i++) for(int i=1;i>=10;i--) }[/CODE] [/QUOTE] besides arrays you should also brush up on for loops... neither of those will even be entered into (seeing as 1 is NOT greater than or equal to 10). For the first loop you'd need to switch it to this for your …

Member Avatar for mirfan00
0
302
Member Avatar for rtwister

[QUOTE=mirfan00;879221] you just declare password as a char ( char password ) . Now compile it it is erorr free. I hope you enjoy it.[/QUOTE] that is assuming their password is something like 'b' or '7' (I hope it's not) and just because something compiles doesn't mean it works ;) …

Member Avatar for tux4life
0
133
Member Avatar for rafaelbrizu

instead of using the ascii codes which would get a bit more complicated when you add numbers because of the disconnect between the codes (since numbers are 48-57 and letters 97-122), why don't you try something like the following as a starting point: [CODE=cplusplus] string random_letter(int length) { const string …

Member Avatar for rafaelbrizu
0
102
Member Avatar for Takafoo

in your revised set of code, try removing the following line: [CODE] int main(int, char**); [/CODE] and what global variables are you referring to?

Member Avatar for Takafoo
0
177
Member Avatar for SallyJ
Re: Loop

code tags really help :) [CODE=cplusplus] std::cout << "k: " << k; [/CODE] or it's really simple to run through that loop in your head... and if you understand what's going on it's even easier to know what the answer is without having to go through the whole loop.

Member Avatar for jesseb07
0
147
Member Avatar for fadia

so, does that solve your problem or (since you never said what the problem was) is there more?

Member Avatar for fadia
0
151