No, diabetes will not really affect your brain functioning directly, unless you have had a stroke/ other evidence of reduced blood flow to the brain (vascular disease). Also I hope you not been having frequent low blood sugar attacks - those can also effect brain functioning. The kinds of symptoms you describe are usually unrelated to diabetes, at 40 years of age.