• 0
  • مالي خلق
  • أتهاوش
  • متضايق
  • مريض
  • مستانس
  • مستغرب
  • مشتط
  • أسولف
  • مغرم
  • معصب
  • منحرج
  • آكل
  • ابكي
  • ارقص
  • اصلي
  • استهبل
  • اضحك
  • اضحك  2
  • تعجبني
  • بضبطلك
  • رايق
  • زعلان
  • عبقري
  • نايم
  • طبيعي
  • كشخة
  • النتائج 1 إلى 3 من 3

    الموضوع: for programers in C++ and Visual C++

    1. #1
      التسجيل
      10-03-2002
      المشاركات
      3
      المواضيع
      1
      شكر / اعجاب مشاركة

      Lightbulb for programers in C++ and Visual C++

      Hello all, i'm new user for montada.com,
      i was having problem in my program in C++
      The Problem :
      i was making a program containing two files the first is a.cpp the second is b.cpp
      i declared some functions in a.cpp like( int counter; int there
      i'd like to use this integers in the second file b.cpp without redefine.
      i tried to re declare this integers in the second file to use them, but i found a problem, ("the integers count and there are redeclared")
      i'm just begginer to c++ and visual c++
      can anyone help ???

    2. #2
      التسجيل
      11-12-2001
      الدولة
      أرض الحرمين
      المشاركات
      1,001
      المواضيع
      740
      شكر / اعجاب مشاركة
      Asslam Alekom ...Brother...

      I did not realy get what you meant when you said :
      some functions in a.cpp like( int counter; int there
      first these are variables not functions.

      any way the solution to your problem is ::
      when you write funtions in a file and you want to use these funtions you have to save this file with the extention .h (like a.h) which means that you try to make it as a liberary.
      Then, when you write the second file and you wnat to include the first file in your second file you have to write in the first lines before the main funtion this line ....[COLOR=green]#include "a.h"[/COLOR [
      ((وَاتَّقُوا يَومًا تُرجَعُونَ فِيهِ إِلَى الله ثُمَّ تُوَفَّى كُلُّ نَفسٍ مَّا كَسَبَت وَهُم لاَ يُظلَمُونَ))

    3. #3
      التسجيل
      10-03-2002
      المشاركات
      3
      المواضيع
      1
      شكر / اعجاب مشاركة
      We aLekom el salam
      Thanks Black Horse for ur help

    ضوابط المشاركة

    • لا تستطيع إضافة مواضيع جديدة
    • لا تستطيع الرد على المواضيع
    • لا تستطيع إرفاق ملفات
    • لا تستطيع تعديل مشاركاتك
    •