6,741 Posted Topics

Member Avatar for jingda

Old threads are not automatically closed because there's no reason why the discussion could not be continued profitably by newcomers. We've discussed the issue of bumping before, and concluded that it's not enough of an issue to introduce such heavy handed methods. However, bumping is indeed frowned upon if the …

Member Avatar for TrustyTony
1
491
Member Avatar for MareoRaft
Member Avatar for NathanOliver
0
140
Member Avatar for oltokom
Member Avatar for oltokom
0
326
Member Avatar for reza.adinata

[QUOTE]When I pass it to funct(&ue), I got the value of umsi correctly, but for the apn, I got the wrong value (seems like garbage).[/QUOTE] It [i]is[/i] garbage. In funct(), you're creating a new object of[ICODE] bts_pdn_con_t[/ICODE] and leaving it uninitialized. What you want to do, I suspect, is print …

Member Avatar for Narue
0
229
Member Avatar for jepapel

>i want my c++ program to display some Greek messages that i will define, but instead i get some garbage It works for me: [code] #include <iostream> int main() { std::cout<<"

Member Avatar for Plato_1981
0
3K
Member Avatar for mrnobody
Member Avatar for RAIMI

[B]>*(T[j]).c_str()[/B] Check a [URL="http://en.cppreference.com/w/cpp/language/operator_precedence"]precedence table[/URL]. Member access has higher precedence than indirection, so you're still trying to call c_str() on a pointer. The arrow operator saves you from having to remember that rule though: [code] T[j]->c_str() [/code]

Member Avatar for RAIMI
0
807
Member Avatar for kalingaRHASTA

[QUOTE=Chilton;1606630]Use a vector.[/QUOTE] "Without using an array" generally means "without storing all of the numbers", which means vector is out too. But even if you could store all of the numbers, doing so would be stupid because it's trivial to write a linear algorithm without wasting memory like that.

Member Avatar for Salem
0
261
Member Avatar for mohanraj.m
Member Avatar for WaltP
0
155
Member Avatar for MareoRaft

[QUOTE]What happens when you set an int or double value to less than the minimum?[/QUOTE] Bad Things™. [QUOTE]I need my program to recognize when a number is smaller then the minimum, and then set the value to equal the minimum instead.[/QUOTE] Or you could just not let your value go …

Member Avatar for mrnutty
0
136
Member Avatar for Pro2000

[QUOTE]Is C# better than ASP.net to download files automatically from the internet, update and retrieve information from databases (especially MySQL)??[/QUOTE] I think you're confused. What exactly are you trying to do? Yes, you want to download files and connect to a database, but for what purpose?

Member Avatar for Pro2000
0
308
Member Avatar for ari$av3s

[QUOTE]You can't. It's a static string and cannot be modified.[/QUOTE] Aroo? prose is an array initialized with a string literal, it can most certainly be modified. [QUOTE][B]>*ptr = *ptr-32;[/B][/QUOTE] Good god, are people [i]still[/i] doing this? The world is not ASCII anymore, folks, use toupper() if you want to be …

Member Avatar for arindam31
0
168
Member Avatar for jas2010

The file format changed between Excel 2003 and Excel 2007. Your solution for the older format won't work on the newer format. How are you reading the files?

Member Avatar for jas2010
0
297
Member Avatar for RAIMI

[CODE]#include <iomanip> #include <iostream> using namespace std; namespace { const int MAX_ELEMENTS = 11; } int main() { // Step 1) Allocate the rows int **table = new int*[MAX_ELEMENTS]; // Step 2) Allocate the columns for (int i = 0; i < MAX_ELEMENTS; i++) table[i] = new int[MAX_ELEMENTS]; // Step …

Member Avatar for Narue
0
581
Member Avatar for kamragunjan
Member Avatar for ineedsomehelp:3

Change this [code] for(d=z; d>=1; d--) [/code] to this [code] for(d=x; d>x-z; d--) [/code] Now tell me why that works and what you were doing wrong. :)

Member Avatar for Arbus
0
215
Member Avatar for Stefano Mtangoo

General discussions of security from a developer's perspective would fit in the Computer Science forum.

Member Avatar for Stefano Mtangoo
0
181
Member Avatar for rayden150

[QUOTE]Don't use the standard libraries with the .h extension, they are out-dated (pre-1998) and are only kept around for backward compatibility[/QUOTE] Technically they're deprecated, but realistically that's a bluff. Even if the standard committee smokes a huge doobie and removes the old C headers in their stoned haze, compiler vendors …

Member Avatar for mike_2000_17
0
256
Member Avatar for MareoRaft

[QUOTE]For Vec a, i use "const" because a is never changed. Correct me if this is the wrong usage.[/QUOTE] a is passed by value, so you're already working with a copy. While it's not wrong to pass by const value, it's not very common. The reason I think your parameter …

Member Avatar for mike_2000_17
0
301
Member Avatar for MareoRaft

[QUOTE]Why is it a bad idea to use the std namespace for my new functions?[/QUOTE] If you mean something like this: [code] namespace std { // Add myfunction() to namespace std void myfunction(); } [/code] It's a bad idea because doing so invokes undefined behavior. If you mean something else, …

Member Avatar for mrnutty
0
150
Member Avatar for Jsplinter

Also note that the lambda return type can be deduced in this case, explicitly specifying it is unnecessary: [code] my_list.remove_if([](int x) { return x == 4; }); [/code]

Member Avatar for Narue
0
233
Member Avatar for potsha

Four years of education doesn't buy you much, does it? You can't even think of a topic on your own.

Member Avatar for kapojian
0
81
Member Avatar for Joemeister

And your immediate problem is what, exactly? You neglected to actually ask a question.

Member Avatar for Tellalca
0
185
Member Avatar for Dani

Not only is your example horribly broken, it's not even a valid example of the point you're trying to make. >void main() Implementation-defined behavior. main is required to return int. >printf("%d,%d,%d",i,i++,++i); Undefined behavior. The commas in an argument list do not constitute sequence points, and ++ modifies its operand. Undefined …

Member Avatar for WaltP
0
662
Member Avatar for daviddoria

[QUOTE]I typically make a Types.h to define all of my types in and then include that in all of my project files. I haven't ever seen this anywhere though, so I assume it is "bad/wrong".[/QUOTE] I do that occasionally as well, though that's not proof that it isn't "bad/wrong". ;) …

Member Avatar for mike_2000_17
0
134
Member Avatar for dilake

For writing 1D barcodes without any special encoding, such as 3 of 9[1], you can download the appropriate font from [URL="http://www.idautomation.com/fonts/free/"]somewhere[/URL] and then simply draw the barcode on an image: [code] Bitmap DrawText(string value, string fontName, float size) { using (var font = new Font(fontName, size, FontStyle.Regular, GraphicsUnit.Point)) { var …

Member Avatar for sknake
0
114
Member Avatar for Dranip

[QUOTE=Aramant Coral;1604808]Graphic design.[/QUOTE] Defend your answer.

Member Avatar for a.oprea
0
125
Member Avatar for harikrishna439

[QUOTE]Is 2 a garbage value here?[/QUOTE] Yes. [QUOTE]Can anyone explain how 2 comes instead of a garbage value?[/QUOTE] If you're expecting something predictable for garbage, then your definition of "garbage" is badly flawed.

Member Avatar for arindam31
0
164
Member Avatar for kedar_challa

>Is there anything better than this. No, not really. The question you should be asking yourself is why do you need this feature in the first place? [url=http://www.research.att.com/~bs/bs_faq2.html#no-derivation]Clicky[/url].

Member Avatar for Karty619
0
725
Member Avatar for thedalek

If you're taking two characters and turning them into the represented integer value, there's more to it than simply adding the two characters together: [code] #include <algorithm> #include <iostream> #include <iterator> #include <string> #include <vector> using namespace std; int main() { string code; cout << "Enter a code: "; if …

Member Avatar for thedalek
0
201
Member Avatar for Sadun89

[QUOTE]But caution: computer programming and drinking don't mix.[/QUOTE] False. My code while under the influence is the stuff of legends. The only drawback is that it rots quickly, like in a couple of hours or so. ;)

Member Avatar for Aramant Coral
-3
174
Member Avatar for rayden150
Member Avatar for sergent
-2
256
Member Avatar for asrockw7

[QUOTE]Oh god here we go again. lol So what is C since technically I've only been using libraries/functions written in C.[/QUOTE] C is a programming language. :icon_rolleyes: It's a glorified text format which compilers use to convert conforming text files into the corresponding machine code for the targeted platform.

Member Avatar for Sodabread
0
587
Member Avatar for sha11e

[QUOTE]* How does stringstream work?[/QUOTE] That's a much deeper question than you probably think. But if you don't mind a heavily simplified code example, here's a simulation of stringstream: [code] #include <cstdio> #include <cstdlib> #include <ios> #include <iostream> #include <limits> #include <string> using namespace std; namespace jsw { class faux_stringstream …

Member Avatar for Narue
0
304
Member Avatar for D33wakar

What makes you think there's a difference? Decimal vs. hexadecimal is a display representation, the underlying bits of corresponding values are unchanged.

Member Avatar for D33wakar
0
407
Member Avatar for sha11e

[QUOTE]I found a page saying that int a = 12; and int a (12); do the same thing.[/QUOTE] Indeed. There's also a third way in C++0x (where the added functionality prevents narrowing conversions): [code] int a{12}; // alternatively 'int a = {12};' [/code] [QUOTE]But is there something special with the …

Member Avatar for Narue
0
102
Member Avatar for syria718

[QUOTE]Of all the errors I've seen for main() , this is the first time for this one...[/QUOTE] Sadly, not the first time for me. Usually the rationalization is that char is an integer type and the return values are all well within the range of char.

Member Avatar for Narue
0
277
Member Avatar for Chamath
Member Avatar for Chamath
0
157
Member Avatar for Sana'a Ala'a

Let me get this straight. You have a final year project about a topic that was never covered in any way, shape, or form during the course? I strongly doubt that. It's more likely that you simply didn't pay attention and deserve to get a failing grade.

Member Avatar for chrishea
-3
54
Member Avatar for cemali_ys

Then print your command instead of trying to execute it and see where the differences lie between your manual command and the generated one.

Member Avatar for cemali_ys
0
143
Member Avatar for deliezer

[QUOTE=DavidtheRaindog;1603385]Hi, I am writing an application in which I make a map of strategies keyed by a string symbol. In order to construct the strategies I pass the constructor a filename, out of which it reads out some data, into an initializing map. It is possible that some data might …

Member Avatar for deliezer
0
331
Member Avatar for Pro2000

[QUOTE]I've been wondering whether the C language can copy files from the internet into the user's device, and whether it can process web pages and databases or not..[/QUOTE] Yes to all of that. Check [URL="http://beej.us/guide/bgnet/"]Beej's guide[/URL] for socket programming to get an idea of how one would access internet data. …

Member Avatar for Pro2000
0
144
Member Avatar for busty043
Re: C++

[QUOTE]anyone can you help me to my C++ i cant take the error everytime i make a program i got error and can you give me a program that can solve the area of Circle In Turbo C. thanks[/QUOTE] ...

Member Avatar for Narue
-2
144
Member Avatar for gujinni

[QUOTE]thus iterators predefined functions?[/QUOTE] Iterators are a concept for range access with a design derived from pointers, where a concept is a set of requirements for accessing the range. For example, find() and for_each() can both be written with a minimal set of requirements (assumptions about the "pointer" type): [code] …

Member Avatar for gujinni
0
105
Member Avatar for tubby123

The asterisk sets your field width to the corresponding argument. So the field width of the first number is the value of [ICODE]a[/ICODE] and the field width of the second number is the value of [ICODE]b[/ICODE]. Since that number of characters will be printed (with spaces for padding), printf() will …

Member Avatar for tubby123
0
167
Member Avatar for Nexgr

target and parent need to be references as well (or pointers to pointers) if you're using them as output parameters: [code] void find(string cod, tree_node* tree, tree_node*& target, tree_node*& parent, bool& found); [/code]

Member Avatar for Nexgr
0
152
Member Avatar for perfectBing

[QUOTE]Is it mandatory to Use static functions for a Singleton class.[/QUOTE] It's not mandatory, but that's probably the most common implementation of the Singleton pattern. [QUOTE]But If you want to use it for production purpose[/QUOTE] Then I would ask why you think you need a Singleton. In my experience, they're …

Member Avatar for alwaysLearning0
0
85
Member Avatar for Valiantangel

I know you asked about the conditional operator, but the following is a more conventional way of adding leading zeros to a fixed field width: [code] #include <iomanip> #include <iostream> using namespace std; int main() { short hour = 9; short minute = 10; short second = 5; char last_fill …

Member Avatar for Narue
0
168
Member Avatar for caut_baia

I don't understand the question. Are you asking if reading from a stringstream is faster than reading from an fstream?

Member Avatar for caut_baia
1
109
Member Avatar for VernonDozier

Thread split from [URL="http://www.daniweb.com/community-center/geeks-lounge/threads/371508/1599249#post1599249"]here[/URL].

Member Avatar for VernonDozier
4
193

The End.