2,827 Posted Topics
Re: Line 56 Function call: [code] b = temp (e, a); [/code] temp function : line 209 [code] int temp(int a) [/code] This function expects an integer parameter representing the number of degrees in Fahrenheit and returns an integer representing the number of degrees in Celsius, so give it what it … | |
Re: >> what if I returned 256? it still works.. :c Yes, it still works, but if program A was called by program B and program A worked and returned 256, program B, when control returned to it, would have no way of knowing that program B worked. Program A returns … | |
Re: From the point of view of the technical forums involving posters needing help, everything should be public. I'm done with helping people via PM. I was pretty slow to this. Others were much faster and more steadfast with the "No help via PM" rule and they were right. Regarding projects … | |
Re: One, if you are trying to APPEND to these output files, I see nowhere where you specify a mode when you open the file, so you're going to be overwriting the file, not adding to the end of it. If you want to append to the end of a file, … | |
![]() | Re: >> Might finally teach them some fiscal responsibility. Of all the scenarios, this is the least likely. I suppose it's possible that it'll cause us all to reflect on how we got into this mess, learn some lessons, then come together and try to solve it. That would be unlikely … ![]() |
Re: [QUOTE=blackcathacker;]I quit dealing with you guys xD.[/QUOTE] You can't blame people for giving you smart-aleck answers on this one. If the post was a serious one, you had to phrase it as such and stick it in a real forum. Obviously all real computers involve people placing gates, latches, transistors, … | |
Re: I voted for him, but regret it. Malcolm Peter Brian Telescope Adrian Blackpool Rock Stoatgobbler John Raw Vegetable Brrroooo Norman Michael (rings bell) (blows whistle) Edward (sounds car horn) (does train impersonation) (sounds buzzer) Thomas Moo... (sings) "We'll keep a welcome in the..." (fires gun) William (makes silly noise) "Raindrops … | |
Re: [QUOTE=blackcathacker;1618179] I dont want to be mean or racist, but [/quote] OK, here it comes. Whenever someone starts a sentence with "I dont want to be mean or racist, but..." there is a good chance that whatever comes next will be mean and racist. Let's see... [QUOTE=blackcathacker;1618179] you have to … | |
Re: Not sure about Eclipse. It's most likely quite similar to NetBeans, though possibly with diferent categories and subcategoreies. All Projects will have a "Properties" option, with a bunch of sub-options. In NetBeans, right-click your C++ project and select "Properties". Select the "Run" category from within "Properties". Within "Run", Select "General" … | |
Re: >> And you're suggesting that a bogus member be kept around simply because they can't have their name changed? It would up the membership count and get to that magical million number. >> And what would a second account be used for? I believe that the second account +reps the … | |
As far as I can tell, this is safe. It prints "Should Get Here" and nothing else, as expected and desired. In real life, CantGetHere is a function that actually IS called and does some arithmetic. To avoid a seg fault in line 14, I have a NULL pointer check … | |
Re: [QUOTE=Prankmore;1617388] I am trying to write a program that takes a 10 digit phone number and inserts hyphens between the 3rd and 4th digit and the 6th and 7th digit eg. Enter phone number: 5553459875 Your number is 555-345-9876 I've decided that reading the number as an integer won't work … | |
Re: From your thread in the Geek's Lounge... [quote] Alright, I know it's stupid, but I felt the sudden urge to make a computer without electricity, choosing paper and pencil as my choice. Where do I begin? It would be preferred, to a conclusion,that this be able to solve calculus - … | |
Re: >> It's becoming that time again where Americans have to choose which idiot to vote for. Don't pre-suppose idiocy. You may end up there, but why not go in there hopeful that there might be at least one candidate you may be willing to vote for without holding your nose? … | |
Re: [quote] I am having trouble with this because I am not suppose to use reference variables. [/quote] And indeed you are not. However, you are CALLING your function as if you ARE passing by reference. Lines 5 and 56: [code] int askUser(int balance) askUser(balance); [/code] Note that in line 5, … | |
Re: [QUOTE=jess64k;]Actually I just realized I forgot to mention that the stack of integers is an ARRAY, not sure if that changing things? Since if I remember correctly, arrays are always passed by reference.[/QUOTE] Yep, changes it A LOT. You remember correctly. Arrays are passed by reference. [code] total = sumStack(mystack) … | |
Re: Dig out the old statistics book and look up how to calculate the number of permutations and combinations. There are several ways to approach it. Beware of duplicates. C++ make life much easier because it'll test for it. Look at STL. There are quite a few containers in it that … | |
Re: >> I believe it is a pointer to an array of char arrays. Let's see. The address of the first element of a char array would be a char*. The address of the first element of an ARRAY of char arrays would likely be a char**. A pointer to THAT … | |
Re: Produces garbage where? What is happening that shouldn't, or vice versa? Lines 226 and 227 - You should seed ONCE. Move these lines to line 22. [code] void determinewinner(char board[length][width], int width, bool gamefinished) [/code] Note that gamefinished is NOT passed by reference and hence changing it in the function … | |
Re: >> Do ensure that all posts contain relevant content and substance >> and are not simply vehicles for external links, including signature links Not necessarily an either/or. What about people who post stuff like you just posted ("thank you diz iz greeeeat post!") but who don't have an ulterior motive … | |
Re: Comments... Get rid of the tabs. You can see what happens when you assume 4 spaces and Daniweb assumes 8 spaces. Convert tabs to spaces. [code] //Generates alphabetical digits for the given base void genDigs(int base,char *digs){ if (base>36){ //Because for bases greater than 36,the capital alphabets are not enough … | |
>> their database already have your account user name and password They had better NOT have your password in their database. If they do then they're completely incompetent and you need to run like the plague. No database should ever store a user's password. Instead it should store a one-way … | |
Re: >> anybody know how to explain this??? Yes, [url]http://www.cplusplus.com[/url] and a variety of other sites explain it all. If you have problems understanding their explanations, post back here. Don't expect anyone to write a detailed tutorial on vectords, namespaces, etc. They've already been written and are all over the place. … | |
Re: >> firstperson will i have to use another header for your example code? >> ok so i swore i've done something like this before probably thinking of java though You WERE thinking of Java. There is no replaceAll in C++. You have to write your own. Since you have to … | |
Re: There may be a build-in Windows library that's easier, but I always use libcurl for this kind of thing. It might be a little difficult for a "beginner". I'm not sure. You'll need to download libcurl, install it, and link to it. It's not difficult to use, but again, I … | |
Re: >> I expected it to work,but it takes 4 numbers instead of 3. No it takes an infinite number of numbers for those of us who DON'T enter numbers that need to be rejected. [EDIT] Someone down-rep me please. I can't believe I just posted that. I could edit it … | |
![]() | Re: It would be cool if each user could create their OWN formula of what a leech is. That way there would be no awkwardness of "official" leeches", but you could set your own weed-out function like (if post count > 100 and % of posting in a thread not yours … |
I have a simple program. [code] // test.c #include <stdio.h> int main() { #ifdef HELLO printf("Hello "); #endif printf("World\n"); return 0; }[/code] I'd like to set up a makefile and either define HELLO or not in that Makefile and then either the program displays "World" or "Hello World" based on … | |
Re: I am seeing a read on line 34 as well, into the variable line. However, you simply read it into that variable and never use it. I see a couple of commented out lines that display it, but it never gets into any of your other variables and it looks … | |
Re: [QUOTE=cppgangster;]All I want is to find my neighbour wifi key... and fullfill my life of enjoyment of a free internet...[/QUOTE] Oh well if that's the reason then all you need to do is... Seriously, no one can help you. 1) It's against the rules. 2) Started to write 2, but … | |
Re: [QUOTE=murnesty;]poor me.. i don't know the problem on 4,5,6...[/QUOTE] 4) Enter in "bad" values like ""error" (anything that's not a legal int) and see if the function recovers correctly so that the code works when you finally enter GOOD data. 5) Can you ever enter a valid score and not … | |
Re: Unless you want to say that people who earn their living writing Perl scripts and shell scripts aren't programmers, I'd have to put "scripting" as a subset of "programming". You might need to clarify what "There is no difference." If the question is "Are script writers bona-fide programmers as opposed … | |
Re: Stick Salem on the list. He's not a mod, but deserves kudos for all that "no code tags" reporting. On a side note, out of curiosity, what's the time commitment involved and more importantly, what's the breakdown? I.e. what percentage of your effort is spent banning spammers versus, say, monitoring … | |
Re: I'm not sure what code is inside your class calc and what isn't, and what my_a is, so I won't comment on your code. If you have a 2-D array and you need a function that takes a 2-D array and that function manipulates array elements, here's an example... [code] … | |
Re: [QUOTE=Agilemind;]That is a communication error on the part of the Military or Delta or both. Who ever was responsible for telling them they could check 4 bags free should be picking up the tab.[/QUOTE] Yep, it could have been the bureaucracy on either side. I can't imagine the individual soldiers … | |
Re: If you want the compiler to be "unkind", turn on all warnings with the -Wall flag and then turn on the -Werror flag, which turns warnings into errors and aborts. Thus this will not compile using the following command... [code] g++ unused_var.cpp -Wall -Werror [/code] [code] int main() { for(int … | |
Re: You're in good company struggling with these questions. Many before have struggled with them. You're not likely to get much new advice on this. It's been done to death as they say. I sincerely doubt you'll ever "solve" this. You'll decide to either continue as a Christian, contradictions and all, … ![]() | |
Re: A few possibilities. First a request for clarification. I see this code on lines 230 and 231, which I assume is what you are referring to in your short code stub. [code] player.accumulate(); cout << player.getWon(); [/code] I also see this quote... [quote] For example when I increment the number … | |
Re: I don't think that's what niek meant. The compiler gave you a line number with the error, yes? Post that line of code, plus whatever other lines you think may be needed to give you help. Use C++ style code tags [noparse] [code=cplusplus] // paste code here [/code] [/noparse] so … | |
Re: >> Is there other way to evaluate if a pointer of structure is NULL? [code] if (encontrado==NULL) [/code] You already do it here. Not sure I understand the question. >> buscar() returns NULL if the data already exists, else returns pointer of the leaf. If the data already exists in … | |
Re: It's an initializer. It's the same as this... [code] SockerManager::SocketManager() { sockets = 0; events = 0; nSockets = 0; } [/code] [code] #include <iostream> using namespace std; class SocketManager { private: int sockets, events, nSockets; public: SocketManager(); void print() { cout << sockets << '\t' << events << '\t' … | |
Re: There are only so many ways of doing some stuff. In order for something to be copyrightable, it has to be at least difficult so that not every mediocre programmer or author could belt out the same thing you did. It has to be different enough so that every advanced … | |
I have the following code. It's a memcmp implementation for the Renesas R5F Embedded Chip family and I'm trying to test it. [code] #include <stdio.h> #include <time.h> #include <stdlib.h> #include <math.h> #include <stdbool.h> #include <stdlib.h> #include <assert.h> typedef char SInt8; typedef unsigned char UInt8; SInt8 one_net_memcmp(const void *vp1, const void … | |
[code] #include <stdio.h> #if 1 //! Set Pin string const char* const ONCLI_SET_PIN_CMD_STR = "set pin"; #endif const char* const SINGLE_APP_STRINGS[] = { ONCLI_SET_PIN_CMD_STR }; int main() { printf("%s\n", SINGLE_APP_STRINGS[0]); getchar(); // pause return 0; } [/code] Line 12 Error message... [code=text] 12|error: initializer element is not constant 12|error: (near … | |
Re: inFile is declared, but there's no input stream associated with it. You need to open a file using inFile before you can use it to read from that file. inf is passed to the function. perhaps you don't need inFile at all? Perhaps you should read from inf? Lines 3 … | |
Re: >> Also did a call the variable right later in the program? You don't call a variable. You call a function using a variable as a parameter. Without seeing the function, it's hard to tell whether you called it right. | |
Re: >> my professor gave a .o file and we are supposed to write a function that links to his file in ssh. Terminology is important. I assume "ssh" means "secure shell". ".o" file means "object code". "Links to his file" means link the object code. "In ssh" doesn't really mean … | |
Re: >> and I am not sure I am going in to right direction or not. Does it give you the right answer? Does it give you the right answer no matter what's in the input file? Then it's probably right. If not, it's wrong. What's the data file look like, … | |
Re: First get your swap correct. You can't sort, shuffle or do anything with rows till your swap is correct. If rows are considered elements, then you can't split them up. That means that in order to swap, you have to either loop through the row one element at a time … |
The End.