
This may occur when the source file is compiled as C.
If it is a plain C file (.c) you should not include cstdio but stdio.h.
If it is a C++ file (or should be compiled as such), set the appropriate option in the project settings (I have no VS21012 here but it should be at "C/C++  Advanced"  "Compile As") to compile all files as C++, or rename source files to .cpp.





Dear
I have done it several times, but same errors are getting produced. Problem is not with code...problem is if vc++ 2012 compiler IDE...
Am I missing some library/ switch..?
Pankaj





I can't really help without knowing what you are doing and do not have VS2012 here.
But this should compile (console project with precompiled headers):
#include "stdafx.h"
#include <cstdio>
int _tmain(int argc, _TCHAR* argv[])
{
FILE *f = fopen(_T("test"), _T("r"));
fclose(f);
return 0;
}






Dear programmer,
Code does not have any issue...VS 2012 IDE setting has...
Even I posted same problem in several boards..a programmer suggested that I should make a simple program on Visual C++ 2012 IDE, with <cstdio>. I made a simple app with only <cstdio>..(library/header...namespace as documentation says of microsoft). Again same error on compilation...
1>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cstdio(39): error C2039: 'fclose' : is not a member of '`global namespace''
1>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cstdio(39): error C2873: 'fclose' : symbol cannot be used in a usingdeclaration
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========..
Am i missing some setting..?
Pankaj





I used VC++ 2008...there is not as much fussy issue, as VC++ 2012 is producing(useless hurdles)....program itself has complex logic...
Issue is closed..I changed environmnt vc++ 2008..






This has nothing to do with C/C++ programming.





Not really a question for a programming site but as it's in my area. You configure the LM317T as a current source you can neglect the voltage totally. There is a formula for trickle charge rate of NiMh an online calculator is here Rechargeable battery charging time and mA current calculator  Convert to units and culinary measures.[^]
For a 2000maH stack maximum trickle charge rate is 66mA which is well within range of your solar panels. You can't charge any faster using a simple LM317T circuit otherwise you will damage the batteries.
Finally the circuit is shown here (second one with the solar panels)
NiCad Battery Charger with LM317  Jose Pino's Projects and Tidbits.[^]
The 22 Ohms on the circuit will give you 56mA of trickle charge .. if you want exact max 66mA you need 19 Ohm 1/2 Watt resistor.
The diode protect (1N4001) protects the solar panels when they aren't in sunlight
You want a more advanced charger go to a proper electronics hobby site and not here
In vino veritas





It is site driving spam.
The text has been copied from a 2014 StackExchange post and extended with a link to the distributor.





Haha I get it now .. will ignore in future.
In vino veritas





Messagepassing on the binary erasure channel
Code word =[1 0 0 1 0 1]
Y= [1 0 0 x x 1]
Procedure DECODE(Y)
I= 0
For i= 1 :n do
Mi=yi
end for
repeat
for j= 1 :m do
for all i ∈Bj do
if all messages into check j other than M i are known then
end if
end for
end for
for i= 1 :n do
if Mi= ‘unknown’then
Mi=Ej,i
end if
end if
end for
if all Mi known or I =Imax then
Finished
else
I=I+ 1
end if
until Finished
end procedure






I am working LDPC encoding and decoding for mini project work. With my effort i have completed LDPC encoding but struggling with LDPC decoding.
Messagepassing on the binary erasure channel
Code word =[1 0 0 1 0 1]
Y= [1 0 0 x x 1]





Can anyone help me in writing C languageLDPC Decoding:Looking for logic using algorithm.algopng for decoding procedure. Please give me logic.






I have already know that in Wikipedia, Lowdensity paritycheck code is given but not the logic. I have gone through all the theory parts. Thanks for your logic.





If you have gone thru the problem them you should have already realized, you can't decode anything until you first sort out the type of encoding. LDPC isn't one thing it is a verbose description of any number of schemes it is an NPcomplete code problem. So you may have read the wikipedia article but you don't understand it.
Effectively you just asked us to help us build a vehicle and we don't know if it's a car, boat, truck, train, hovercraft or plane.
Look all I can do is point you at
GitHub  jontio/LDPC4Qt: Forward Error Correction using LDPC codes with Qt C++[^]
As it says the code on there is too slow and totally useless for any sort of real world use it will just get you to understand LDPC codes.
In vino veritas





Hi,
I have completed my LDPC encoding part and got output. Now i switched over to LDPC decoding part. I know procedure of LDPC decoding very well, but in Coding part i am feel little bit difficult.





If you know it very well, you should be able to write down the steps. Once you have the steps written down, you should then be able to further break them down into logical programming structures. You solve this just like any other programming problem by breaking it down and down until you have a clear understanding of what code needs to be written.
This space for rent





So what form of the decoder are you trying to write?
Some I am familiar with, others I am not. I don't claim to know every type of LDPC decoder on the planet.
If you haven't chosen one then perhaps read an analysis .. this was done for the DVBS2 specification
[Investigation of LDPC code in DVBS2]
In vino veritas
modified 21Jun17 9:29am.





I know concepts of message_passing decoding or bit_flipping decoding techniques. So i am trying C codes for message_passing decoding or bit_flipping decoding.





Actually i am not getting about the type of decoder concerned with partially parallel or fully serial bcoz I have to implement the LDPC decoder with the help of belief propagation algorithm.In that process i have been provided with a H matrix,code word like [0 0 1 0 1 1] for a 4*6 matrix.The received word is r=[1 0 1 0 1 1] with a cross over probability of p=0.2.
Now the steps which i have to follow for computation is as follows:
1.in the first step using logp/1p i have to find out the received word and it comes like
r=[1.3863,1.3863,1.3863,1.3863,1.3863,1.3863]
2.Since it is a 4*6 matrix
M11=r1=1.3863 and M31=r1=1.3863
for i=2,M12=r2=1.3863 and M22=r2=1.3863
.
.
.
.
for i=6 M36=r6=1.3863 and M46=r6=1.3863
3.Extrensic information.It is calculated by using formula
E11=log(1+tanh(M12/2)tanh(M14/2)/1tanh(M12/2)tanh(M14/2))
Like that i have to calculate for eacha nd every node and finally a E matrix has been formed
4.calculation of LLR
L1=r1+E11+E31=some value
.
.
.
.
L6=some value
finally on the basis of BPSK scheme
Z=[0 0 1 0 1 1]
5.To check if Z is a valid codeword
S=Z.H transpose
if it comes like [0 0 0 0] then my code word is correct otherwise have to go for next iteration.
Please tell me how should i proceed.Its a total mathematical calculation.I am stuck with the point of taking matrix as a input.If i take it as an array also then how should i calculate that tanh calculation.





You have totally lost me ... you are giving me the formulas
tanh is a standard C/C++ function (C library function  tanh)
You have the matrix coefficents and like you said the E matrix first coefficent is
E11=log(1+tanh(M12/2)tanh(M14/2)/1tanh(M12/2)tanh(M14/2))
So plug the numbers in and calculate your E matrix coefficents
You do all your other calculations and then transpose the matrix .. you know
C Program to Find Transpose of a Matrix]
You need to explain this statement => "how should i calculate that tanh calculation". I simply don't get it tanh is a trig function like sine/cosine/tan and it just needs "#include <math.h>" and you have it on any C/C++ compiler that meets the oldest C89 standard.
You gave me coefficent values above so I know you know what M12,M14 are and you know what a 2 is.
So I query why you ask me how do you do the tanh calculation, why didn't you ask me how you do the log calculation? What is the difference between those that is causing your problems?
In vino veritas
modified 22Jun17 16:52pm.





Hi
I had a block of code in my project that was repetitive. So I decided to make it a MACRO
In my block of code I had a For loop, which needed int i; as a variable
in order to make it unique I tried to use __COUNTERS__ macro
e.g. i##_COUNTERS__. I was never able to get the code to compile
I came upon a alternate solution wrapping the code around curly braces
As I remember anything declared within curly braces is unique to that block
of code. Am I correct in this
thanks



