2,827 Posted Topics

Member Avatar for PratikM

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 …

Member Avatar for PratikM
0
218
Member Avatar for triumphost

>> 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 …

Member Avatar for SnowFall
0
273
Member Avatar for Netcode

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 …

Member Avatar for Netcode
-1
193
Member Avatar for thecoolman5

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, …

Member Avatar for VernonDozier
0
267
Member Avatar for iamthwee

>> 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 …

Member Avatar for iamthwee
0
142
Member Avatar for blackcathacker

[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, …

Member Avatar for blackcathacker
0
248
Member Avatar for Sadun89

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 …

Member Avatar for zachf632
0
222
Member Avatar for Netcode

[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 …

Member Avatar for Netcode
-1
150
Member Avatar for adam25

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" …

Member Avatar for adam25
0
353
Member Avatar for MooGeek

>> 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 …

Member Avatar for MooGeek
0
190
Member Avatar for VernonDozier

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 …

Member Avatar for VernonDozier
0
182
Member Avatar for Prankmore

[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 …

Member Avatar for Prankmore
0
354
Member Avatar for blackcathacker

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 - …

Member Avatar for happygeek
-4
173
Member Avatar for pseudorandom21

>> 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? …

Member Avatar for pseudorandom21
0
660
Member Avatar for br0wnm4n

[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, …

Member Avatar for WaltP
0
1K
Member Avatar for fsefsef23

[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) …

Member Avatar for fsefsef23
0
266
Member Avatar for IndianaRonaldo

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 …

Member Avatar for IndianaRonaldo
0
294
Member Avatar for IMJS

>> 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 …

Member Avatar for fruitymo
0
117
Member Avatar for josh327

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 …

Member Avatar for VernonDozier
0
249
Member Avatar for jingda

>> 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 …

Member Avatar for TrustyTony
1
491
Member Avatar for massivefermion

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 …

Member Avatar for massivefermion
0
475
Member Avatar for VernonDozier

>> 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 …

Member Avatar for VernonDozier
4
193
Member Avatar for gujinni

>> 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. …

Member Avatar for gujinni
0
270
Member Avatar for TheLittleEngine

>> 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 …

Member Avatar for sfuo
0
164
Member Avatar for roidw

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 …

Member Avatar for VernonDozier
0
86
Member Avatar for theguitarist

>> 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 …

Member Avatar for m4ster_r0shi
0
189
Member Avatar for diafol

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 …

Member Avatar for VernonDozier
0
156
Member Avatar for VernonDozier

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 …

Member Avatar for VernonDozier
0
176
Member Avatar for mchin131

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 …

Member Avatar for NathanOliver
0
156
Member Avatar for cppgangster

[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 …

Member Avatar for VernonDozier
0
91
Member Avatar for mrnutty

[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 …

Member Avatar for Moschops
0
144
Member Avatar for mariko

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 …

Member Avatar for vegaseat
0
165
Member Avatar for jingda

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 …

Member Avatar for jingda
-1
126
Member Avatar for winecoding
Member Avatar for akhal

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] …

Member Avatar for NathanOliver
0
419
Member Avatar for Ancient Dragon

[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 …

Member Avatar for jwenting
-2
167
Member Avatar for sergent

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 …

Member Avatar for sergent
0
144
Member Avatar for mrnutty

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, …

Member Avatar for iamthwee
2
1K
Member Avatar for henrimontreal

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 …

Member Avatar for VernonDozier
0
830
Member Avatar for hezechiel

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 …

Member Avatar for nmepntgrm
0
1K
Member Avatar for montjoile

>> 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 …

Member Avatar for gusano79
0
140
Member Avatar for dev344

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' …

Member Avatar for dev344
0
146
Member Avatar for Abel123

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 …

Member Avatar for jingda
0
709
Member Avatar for VernonDozier

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 …

Member Avatar for VernonDozier
0
206
Member Avatar for VernonDozier

[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 …

Member Avatar for VernonDozier
0
332
Member Avatar for AlvinLiu

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 …

Member Avatar for VernonDozier
0
145
Member Avatar for C++NewBe

>> 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.

Member Avatar for YOUSAFZAI
0
123
Member Avatar for pok.kys90

>> 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 …

Member Avatar for VernonDozier
0
212
Member Avatar for pok.kys90

>> 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, …

Member Avatar for pok.kys90
0
244
Member Avatar for leetari

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 …

Member Avatar for leetari
0
4K

The End.