|
look for any c++\cli book! it would better if you look forward to c#, as generally don't find many project in maanged c++
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
I was trying to figure out the code written by Tejpal Singh Chhabra on back-propagation in c++. I liked the code but I cant understand why three dimensional array is used for allocating weight.Can anybody please explain me logic behind this.I am bad in pointers.
Thanks in advance.
|
|
|
|
|
I have no idea about the code, or the problem as such, but if they're allocating a 3d array to store weight values, I'd strongly guess it's because the weight is a function of 3 independent variables?
Say you like a certain combination of cars.
BOOL MyLiking [NUMBEROFCOLOURS][NUMBEROFDOORS][NUMBEROFMANUFACTURERS];
...
MyLinking [RED][2][NUM_SKODA] += 50;
MyLinking [BLUE][4][NUM_BMW] -= 50000;
...
}
I hope that makes a littttttttle bit of sense.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Neural Network, one of some thing i fear most
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
I need to change the TOS field of all packet I send. I am not use to program I do not success to make operated this code.
<br />
WSADATA WSAData; <br />
WSAStartup(MAKEWORD(2,0), &WSAData); <br />
<br />
SOCKET sock; <br />
SOCKADDR_IN sin; <br />
sin.sin_addr.s_addr = inet_addr("192.168.4.33");<br />
sin.sin_family = AF_INET;
sin.sin_port = htons(10000);
<br />
sock = socket(AF_INET, SOCK_RAW, 0); <br />
bind(sock, (SOCKADDR *)&sin, sizeof(sin));
<br />
int TOS=0x80; <br />
<br />
while(1)<br />
{<br />
setsockopt(sock, IPPROTO_IP, IP_TOS, (char *)&TOS, sizeof(TOS));<br />
<br />
if (setsockopt(sock, IPPROTO_IP, IP_TOS, (char *)&TOS,<br />
sizeof(TOS)) == SOCKET_ERROR)<br />
printf("\nWarning: Fail to set TOS value: error - %d",<br />
WSAGetLastError());<br />
} <br />
system("PAUSE");<br />
return EXIT_SUCCESS; <br />
}<br />
Someone would have a solution? I just try to modify TOS field at the value 0x80 using the function setsockopt().
Cedric
modified on Friday, March 28, 2008 4:57 AM
|
|
|
|
|
|
So do you know an other issue to mark all TOS IP header fields from all outcoming packets?
|
|
|
|
|
which is the best way to read a line from a text file in c.. the size is not known. and this text needs to be stored in a CString.
|
|
|
|
|
If you're reading it in C, then you can't store it in a CString (C++).
For MFC, you can use CStdioFile and its member function ReadString .
In C, it's a bit harder - you have no idea about the buffer length for your TCHARs (you are using unicode compatible code, I hope...), so you're going to have to keep the current file pointer, read through the file until you hit the end, or a carriage return, calculate the size, rewind, then read the string.
Or read the whole file into memory, and act on it as a big chunk of ram, which will be similar, but faster.
And now someone will come along and tell you to use
WinReadStringFromFile (...); (Made up name, before you look for it)
Good luck,
Iain.
Iain Clarke appears because CPallini still cares.
modified on Friday, March 28, 2008 5:48 AM
|
|
|
|
|
Iain Clarke wrote: CStdio
I believe you intended to say CStdioFile
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
I don't understand what you're talking about. You'll have to check your eyesight then look at my post again.
I'm infallible, dammit!
Iain.
ps, message modified to not mislead people...
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Of course this is going on my arrogant...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Now, where's that :whistle innocently: smiley...
Iain.
Iain Clarke appears even though CPallini no longer trusts him.
|
|
|
|
|
Iain Clarke wrote: Iain Clarke appears even though CPallini no longer trusts him.
But loves his sentences.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Iain Clarke wrote: I don't understand what you're talking about. You'll have to check your eyesight then look at my post again.
thats why i quoted the comment dude! nice move
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
ThatsAlok wrote:
thats why i quoted the comment dude! nice move
I would have got away with it too, if it wasn't for you pesky detail oriented developers!
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Iain Clarke wrote: I would have got away with it too, if it wasn't for you pesky detail oriented developers!
thats why there is group called quality control in organization
|
|
|
|
|
Chandrasekharanp wrote: which is the best way to read a line from a text file in c..
That would all depend on how the file was opened.
Chandrasekharanp wrote: the size is not known.
Unless the file is still being written to, how can you not know its size?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
What is the difference between
#include "math.h" and
#include <cmath> </cmath>
and which is better?
Thanks & Regards,
Suman
modified on Friday, March 28, 2008 4:40 AM
|
|
|
|
|
first remove HTML support from your question!
#include<math.h> search for file in path configured in project setting/development env setting
#include "math.h" also search current directory including project/ developement env setting
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
ThatsAlok wrote: #include "math.h" also search current directory including project/ developement env setting
Maybe a minor difference, using the quotes the searches first in the current directory and then in the project/ developement env setting.
This means that you can overrule include files
codito ergo sum
|
|
|
|
|
BadKarma wrote: Maybe a minor difference, using the quotes the searches first in the current directory and then in the project/ developement env setting.
Right you say!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Hi,
Thanks for help.
I actually meant "cmath", but it was deleted bacause of the tags.
Thanks,
Suman
|
|
|
|
|
ohh! CMATH header file is c99 compliant header file, see you don't use .h while including that file!, actually all the function under cmath header files comes under STD namespace!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Hi,
#include "....." is to include the files which are in your current working directory. For eg. if you have created some file which needs to be included in another cpp / c file for using a function or any member the you can use this option.
if u have created a file a.cpp having some generalize function and you want to use this function in every other .cpp program then you can include this source code file in other source code using
#include "a.cpp"
#include <.....> is generally for dev/project Include folders which contains built-in .h files or any other files.
Regards
SG (sgg245@yahoo.co.in)
|
|
|
|