447 Posted Topics

Member Avatar for denizen08
Member Avatar for scriptkiddy
Member Avatar for void64

I'd say the easiest way to do it would be to do something like[code]<form method="post" enctype="multipart/form data" action="submit.php"> <select name="one" onChange="submit('one')"> <option value="1">1st choice</option> <option value="2">2nd choice</option> </select> <select name="two" onChange="submit('two')"> <option value="1">1st choice</option> <option value="2">2nd choice</option> </select> </form>[/code]And then add the [inlinecode]?source=one/two[/inlinecode] as you described. The string one and …

Member Avatar for twomers
0
1K
Member Avatar for dieom

Well. If it's the digits you're interested in you need only do:[code]lint main( int argc, char *argv[] ) { long num = 123; int dig1 = num % 10; int dig2 = (num/10) % 10; int dig3 = (num/100) % 10; printf( "%ld = %d %d %d\n", num, dig3, dig2, …

Member Avatar for Ancient Dragon
0
90
Member Avatar for zephy2

If you want a 2d vector you can do something like: [code=cpp]#include <iostream> #include <vector> // These just make the notation used in the program easier typedef std::vector<float> xVec; typedef std::vector<xVec> xyVec; int main( int argc, char *argv[] ) { // Define the x and y dimensions and the initial …

Member Avatar for twomers
0
485
Member Avatar for Ponomous

It might have something to do with [inlinecode]while (nullexists = true)[/inlinecode]. Do you mean [inlinecode]==[/inlinecode]?

Member Avatar for Ponomous
0
120
Member Avatar for agentmusic

You misunderstand. It's -- [icode]static ExternalInputs_test2_2 test2_2_U;[/icode] For non-pointers you use the . operator. Not ->. Try replacing -> with .

Member Avatar for agentmusic
0
897
Member Avatar for Behi Jon
Member Avatar for joshSCH
Member Avatar for jbennet
-3
486
Member Avatar for Deadmon

>> sizeof( any pointer ) is always the same >> That happens to be true for the garden variety PC of today, but it is not true as a generic statement. Also, on the same system fat pointers are bigger than normal pointers... [url]http://en.wikipedia.org/wiki/Function_pointer#Method_pointers[/url]

Member Avatar for Ancient Dragon
0
165
Member Avatar for squigworm

You can only use that if you're assigning when defining, i.e.[code]int thing[] = { 4, 8, 15, 16, 23, 42 };[/code]If you're not assigning you must use a constant size. Alternatives. Use pointers and dynamically allocate a size you want. Use scalable array containers, like vectors, list or maps.

Member Avatar for squigworm
0
138
Member Avatar for kgomes

You have two options, really. You can either pass in a pointer to char the pointer that you're passing in, or you can return the allocated array, or indeed both, if you really wanted. So... [code]//... char *Test1(int *sizeptr){ char *text = malloc( *sizeptr ); // ... return text; } …

Member Avatar for gerard4143
1
96
Member Avatar for rcaldera43
Member Avatar for something else

As far as I remember multiplication in the frequency domain is more efficient than convolution in the time domain, so fft the signals and multiply 'em out. Also, if you're doing a PhD in physics I'd assume that you'd have access to mathematically orientated software. This is much more easily …

Member Avatar for msiddi13
0
399
Member Avatar for didi00

Does the second program have to do the same thing as the first but must be written differently? You could always do a switch on [inlinecode]readValue[/inlinecode] instead of the if tree.

Member Avatar for didi00
0
104
Member Avatar for efecto
Member Avatar for William Hemsworth
Member Avatar for lancevo3

I assume it's talking about the assignment of [inlinecode]pos=wordlist.begin()[/inlinecode]. If so you'd imagine that wordlist isn't of type [inlinecode]map<string,unsigned>[/inlinecode] from what the error says. Can you post more code so we can see more of what you're doing?

Member Avatar for twomers
0
509
Member Avatar for Gribouillis

I'm no assembly guru, but you might be able to find something were you to decompile it.

Member Avatar for Gribouillis
0
218
Member Avatar for Eusha

Well... were you to decompile to hex and then recompile from modified hex you might be able to squander something... don't know if it'd work, though. Especially if the program depends on libraries and such. For a really simple [code]int main() { printf( "1" ); return 0; }[/code]you might be …

Member Avatar for JasonHippy
0
1K
Member Avatar for subhashkataria2

Show us some code I suppose. You should know how deep each element is, and you can use the debth to see how many spaces are needed I think it'd make sense to print the data to a string, I'd say.

Member Avatar for twomers
0
143
Member Avatar for kingcrim05

Hmm. Can you show us your file? Don't forget to [inlinecode]delete []floatArray;[/inlinecode]

Member Avatar for twomers
0
98
Member Avatar for Odc
Member Avatar for joshSCH

I read none of the replies but I find it so bloody frustrating when I watch a game of football (soccer). The players get paid more than I have probably earned in my lifetime every week and yet they can't stay on their damned feet! Can't they just play the …

Member Avatar for atretrioeciii
0
298
Member Avatar for Creator07

Read here [url]http://www.adrianxw.dk/SoftwareSite/FindFirstFile/FindFirstFile1.html[/url] (and part 2 and 3), and in the retrieving loop you could simply have a counter that's returned by the function.

Member Avatar for varnesh_kp
0
297
Member Avatar for orium

About the spaces it might be worth making a string to do them rather than looping: [code=cpp]#include <iostream> #include <string> int main( void ) { std::string spaces( 10, ' ' ); std::cout<< '#' << spaces << "#\n"; return 0; }[/code] *checks OP's restrictions*

Member Avatar for maverick420
0
1K
Member Avatar for needhelpe

I doubt you'll get any code for free here. So here's an outline of how you might go about it. Grab the input from the user and compare strcmp() it against references, i.e. "January", etc (might want to consider how you'd work with upper and lower case letters). Then grab …

Member Avatar for OSiRiSsk
0
167
Member Avatar for sparksterz

All that changes with iterators that aren't 'int's is the template argument. [url]http://www.cplusplus.com/reference/stl/vector/erase/[/url] [code]std::vector<randomType> myVec; // Fill the vector with something std::vector<randomType>::iterator iter; // const_iterator if you aren't gonna be modifying anything iter = myVec.begin(); // Points to the first element myVec.erase( iter ); // Will delete the first element …

Member Avatar for sparksterz
0
365
Member Avatar for needhelpe

Most things can be divided. Do you mean is divided with no remainder? The modulus operator is your friend here. [code]for ( i=0; i<10; i++ ) { printf( "%d mod 4 = ", i, i%4 ); }[/code]It returns 0 if no remainder would be returned on division.

Member Avatar for shuva
0
126
Member Avatar for siggivara

That's curious. Try doing \r\n instead. Not sure if that'll help, to be honest, but worth a try. Can you get a hex editor and look at the hex of the file and see if the \n character is there? It could just be your editor.

Member Avatar for Tom Gunn
0
667
Member Avatar for needhelpe
Member Avatar for shahab.burki
Member Avatar for twomers
0
66
Member Avatar for atch

Hmm. Hard to say without seeing code, really. You could always [inlinecode]using namespace namespaceOne::namespaceTwo;[/inlinecode] if you wanted to hide the thing.

Member Avatar for atch
0
86
Member Avatar for esesili

>> My question is how can I use a member function of C at D and at D's child classes? I don't understand that sentence. Can you elaborate or show what you mean with a simple example that shows what you want to do even if it doesn't work?

Member Avatar for esesili
0
141
Member Avatar for shaju_nitk
Member Avatar for group256

Someone asked something similar before in [URL="http://cboard.cprogramming.com/cplusplus-programming/107469-custom-loose-coupling-string.html"]another forum[/URL] and you could do something like this.[code=c++]class thing { private: typedef int (*_fptr)(int,int); // Typedef this for readibility of functino pointer std::map<std::string, _fptr> mfp; // Associate a string to a function pointer public: void add( std::string id, _fptr f ) { mfp[id] …

Member Avatar for group256
0
5K
Member Avatar for atch

You could have it so the constructor requires a flag to ID the allocated item... so something like...[code]class base { public: enum derrivableIDs { idBase, idOne, idTwo }; protected: derrivableIDs id; public: base() : id(idBase) { } derrivableIDs getID( void ) { return id; } }; class one : public …

Member Avatar for atch
0
122
Member Avatar for NeoFryBoy

Curious. You should use [inlinecode]std::string[/inlinecode]s really...[code]std::string strItoA(int number) { std::ostringstream sin; sin << number; return sin.str(); }[/code]Though Narue may tell you to [URL="http://cboard.cprogramming.com/cplusplus-programming/82479-opposite-atoi.html#post586132"]generalise[/URL] (which is a good idea, even though she spells it wrong ;)) which is where templates become your friend.

Member Avatar for NeoFryBoy
1
132
Member Avatar for gretty

Check your last thread! [url]http://www.daniweb.com/forums/post936815.html#post936815[/url]

Member Avatar for Dave Sinkula
0
156
Member Avatar for metdos

No. Everyone thinks the one they use is the best. Do something that makes sense. Nobody will complain too much so long as it's sensible.

Member Avatar for Nick Evan
0
111
Member Avatar for nihan1

[url]http://www.sqlite.org/[/url] Never used it, but have heard people speak good about it.

Member Avatar for twomers
0
151
Member Avatar for dumrat

Haven't done template programming in a while, but as far as I remember you only need to specialise a function rather than the entire class. I think this should work, if not it should give you a good idea how to do what you want...[code=c++]template <typename ty> class thing { …

Member Avatar for twomers
0
79
Member Avatar for EvilOrange

First consider not globalising all the variables and consider passing them by pointer or something from main(). Second, the line should be stringarray[j][0] = string[j]; That should be it, methinks. Work on indentation too, perhaps.

Member Avatar for EvilOrange
0
121
Member Avatar for gretty

I'd imagine if you were to wait in the for loop for about a second per iteration it'd be different. The problem is that you're reseeding the rand function so quickly it's being reseeded off the same value. You only need to seed it once, so do it at the …

Member Avatar for twomers
0
462
Member Avatar for gretty

You should read about getline here, [url]http://www.cplusplus.com/reference/iostream/istream/getline/[/url] Personally, I'd use std::string-s and getline... [code=cpp]#include <string> #include <fstream> #include <iostream> int main() { std::ifstream inFileStream( "filename.txt" ); std::string line, file; while( std::getline(inFileStream,line) ) file += line + "\n"; std::cout<< file; return 0; }[/code]

Member Avatar for iamthwee
0
384
Member Avatar for Stefano Mtangoo

[url]http://www.codeguru.com/forum/showthread.php?t=302806[/url] First hit on google. Basically, it extracts segments from a varaible, i.e. the higher or lower 16 bits.

Member Avatar for Stefano Mtangoo
0
444
Member Avatar for Ancient Dragon
Member Avatar for MosaicFuneral
0
155
Member Avatar for ndeniche

Well. I haven't read the rest of these pages but I don't think I could stand dating someone who didn't interest me intellectually. I would definitely get bored after a week (from experience). Without a doubt personality/intelligence would be near the top of my 'list', while looks do not hold …

Member Avatar for ditz
0
1K
Member Avatar for scru

In terms of education, healthcare etc I don't think anyone can really have an educated view on this unless they lived in both nations for long enough period, say about ten years. In both cases the decision would be a 'lesser of two evils' answer -- none are perfect. You …

Member Avatar for jbennet
0
333
Member Avatar for razor1234
Member Avatar for Ancient Dragon
0
232

The End.