Page 1 of 6 1234 ... LastLast
Results 1 to 12 of 64

Thread: Ask any Question About C++ here!

  1. #1
    SufyanGujar is offline Senior Member+
    Last Online
    29th December 2010 @ 10:59 PM
    Join Date
    10 Oct 2009
    Location
    England, UK
    Age
    34
    Posts
    157
    Threads
    10
    Credits
    0
    Thanked
    7

    Lightbulb Ask any Question About C++ here!

    Hi Guys!

    Mein ne note kia ke bohat log C++ ko lekar confuse hain,
    so main ne yeh thread banaya hai, agar aap C++ ke mutalaq
    koi bhi question pochna chahtein hoon to yahan poch saktein
    hain, i will try my best to help u guys out!
    One more thing, plz dont spam this thread with unnecessary comments.

    Shukaria,
    -Saif

  2. #2
    harifal is offline Junior Member
    Last Online
    18th May 2013 @ 07:31 PM
    Join Date
    01 Feb 2009
    Age
    34
    Posts
    2
    Threads
    0
    Credits
    945
    Thanked
    0

    Default

    salam dear
    it is stated that i have a problem in c++.i want to make digital watch through in c++.
    so please send me its codes.i will wait..
    Thanking you
    yours sincerely
    M.Naeem

  3. #3
    SufyanGujar is offline Senior Member+
    Last Online
    29th December 2010 @ 10:59 PM
    Join Date
    10 Oct 2009
    Location
    England, UK
    Age
    34
    Posts
    157
    Threads
    10
    Credits
    0
    Thanked
    7

    Default

    Quote harifal said: View Post
    salam dear
    it is stated that i have a problem in c++.i want to make digital watch through in c++.
    so please send me its codes.i will wait..
    Thanking you
    yours sincerely
    M.Naeem
    Please explain the sunario in detail, where u upto and on what u r stuck,
    There is no point of making digital Clock all by myself cuz u wont learn
    a thing unless u try and understand it urself. or if u jst want the source
    jst go ahead, type C++ digital Clock Source in Google and u will get clock
    and source.

    Here is source, i still suggest u try urself.
    Code:
    int sec = 0;
    int min = 0;
    int hour = 0;
    while(1)
    {
       sleep(1000); //delay in milliseconds
       ++sec;
        if(sec == 60)
        {
          sec = 0;
          ++min;
           if(min == 60)
           {
               min = 0;
              ++hour;
              if(hour == 24)
              {
                 hour = 0;
              }
           }
        }
       display(hour, min, sec);
    agar aap ko kio bhi problem ho, plz feel free to ask.

    -Saif
    Last edited by SufyanGujar; 13th November 2009 at 04:20 PM.

  4. #4
    naveedthakur is offline Junior Member
    Last Online
    5th February 2013 @ 02:03 PM
    Join Date
    08 Nov 2009
    Age
    39
    Posts
    2
    Threads
    0
    Credits
    0
    Thanked
    0

    Default

    hello ap ne bohat acha cource rakha hai lekin mujhe parhne main dushwari ho rahi hai kia ap mujhe complete cource mail kar sakte ho my ID is naveedit************* plz reply

  5. #5
    SufyanGujar is offline Senior Member+
    Last Online
    29th December 2010 @ 10:59 PM
    Join Date
    10 Oct 2009
    Location
    England, UK
    Age
    34
    Posts
    157
    Threads
    10
    Credits
    0
    Thanked
    7

    Default

    Quote naveedthakur said: View Post
    hello ap ne bohat acha cource rakha hai lekin mujhe parhne main dushwari ho rahi hai kia ap mujhe complete cource mail kar sakte ho my ID is naveedit************* plz reply
    Bhai wo course Abdul Moheed ne rakha hai,
    main ne nahi, so agar aap ko course ke bare
    mein koi bhi information leni ho to un ko
    PM karo.

    waise to unhoon ne sara course images mein
    post kiya hai, so u can right click and save image
    to ur computer...

    -Saif

  6. #6
    Green_Rose is offline Junior Member
    Last Online
    8th March 2010 @ 02:29 AM
    Join Date
    22 Jun 2009
    Posts
    3
    Threads
    0
    Credits
    617
    Thanked
    0

    Default

    C++ mian kuch "alphabets" ko "ascending order" main kaisay likhain gai.......

  7. #7
    SufyanGujar is offline Senior Member+
    Last Online
    29th December 2010 @ 10:59 PM
    Join Date
    10 Oct 2009
    Location
    England, UK
    Age
    34
    Posts
    157
    Threads
    10
    Credits
    0
    Thanked
    7

    Default

    Quote Green_Rose said: View Post
    C++ mian kuch "alphabets" ko "ascending order" main kaisay likhain gai.......
    Well u need to provide more details and
    be specific, anyways, to sort strings in order
    assending or decending, you basically
    have to compare data.
    For example if u r using strings u
    will need to compare em
    and swap values:

    Code:
        IF (the value of item1 is greater than the value of item2)
        THEN
            swap the values of item1 and item2
        END IF
    
        IF (the value of item2 is greater than the value of item3)
        THEN 
            swap the values of item2 and item3
        END IF
    I do have a simmilar program that i made in VB6,
    If u wana have look i can upload dat for u,

    Edit:

    ok i had time so i made u a better example:
    Code:
    #include <iostream>
    #include <string>
    
    
    using namespace std;
    
    int main()
    {
        string item1, item2;
        string Solution;
        
        cout << "Please Enter First Word:\t";
            
        cin >> item1;
        
        cout << "\nPlease Enter Second Word:\t";
        
        cin >> item2;
        
        if (item1 > item2)  { Solution = item1; item1 = item2; item2 = Solution; }
          
        cout << "Sorted in Accending Order:\n\n";
           
        cout << item1 << "\t" << item2 << "\n\n";
        
            
    	system ("PAUSE");
    	return 0;
    
    }
    Basicaly it takes two inputs and compare em,
    then print results to screen after testing condition.
    its very simple and esy, hope u understand...

    -Saif
    Last edited by SufyanGujar; 17th November 2009 at 01:30 AM.

  8. #8
    grand gamer99's Avatar
    grand gamer99 is offline Senior Member+
    Last Online
    8th July 2012 @ 01:45 PM
    Join Date
    26 Aug 2009
    Location
    Lahore
    Posts
    81
    Threads
    20
    Credits
    0
    Thanked
    4

    Default Asalam o alikum


    help plz

    heres a code of a digital watch but yaar ye compile kar ke dekho aik problem ho rahi hai exe main ye seconds key badley hours count karta hai compile and see urself i cant define properly anyway help me with this watch
    Code:
    #include <iostream>
    #include <windows.h>
    
    using namespace std;
    
    int main()
    {
    int sec = 0;
    int min = 0;
    int hour = 0;
    for(sec=0; sec<1000+1; sec+=1)
    {
    system("CLS");
    cout << hour << ":"<< min << ":" << sec << endl;
    Sleep(1000);
    if (sec == 60);
    {
       sec = 0;
       ++min;
          }
    if (min == 60);
    {
          min = 0;
          ++hour;
          }
    
    }
      getchar();
    return 0;
    }
    yar koi to .cpp files ki attachments ki request karay i dont know how to request for a feature
    anyway is ko compress ker kay file bhi bhej raha hoon plz help



    Attached Files Attached Files
    Last edited by grand gamer99; 19th November 2009 at 03:45 PM.

  9. #9
    grand gamer99's Avatar
    grand gamer99 is offline Senior Member+
    Last Online
    8th July 2012 @ 01:45 PM
    Join Date
    26 Aug 2009
    Location
    Lahore
    Posts
    81
    Threads
    20
    Credits
    0
    Thanked
    4

    Default

    haan aik aur baat saif bhai main to dev c++ use karat hun jab k app vb

  10. #10
    SufyanGujar is offline Senior Member+
    Last Online
    29th December 2010 @ 10:59 PM
    Join Date
    10 Oct 2009
    Location
    England, UK
    Age
    34
    Posts
    157
    Threads
    10
    Credits
    0
    Thanked
    7

    Default

    Quote grand gamer99 said: View Post
    haan aik aur baat saif bhai main to dev c++ use karat hun jab k app vb
    I dont use Visaul Basic to compile C++ projects,
    acutally it isnt possible to do so, i use Visual Studio
    mean its got Visual C++, Visual C#, Visual Basic etc
    i can use Visual Studio to compile any code in those
    languages..

    And about ur code, u dont add ; (semi-colon) after
    if statement testing condition...
    here is code that will work.

    Code:
    #include <iostream>
    #include <windows.h>
    
    using namespace std;
    
    int main()
    {
    int sec = 0;
    int min = 0;
    int hour = 0;
    for(sec=0; sec<1000+1; sec+=1)
    {
    system("CLS");
    cout << hour << ":"<< min << ":" << sec << endl;
    Sleep(1000);
    if (sec == 60)
    {
       sec = 0;
       ++min;
          }
    if (min == 60)
    {
          min = 0;
          ++hour;
          }
    
    }
      getchar();
    return 0;
    }
    Please dont mind but u dont have to spam 3 posts
    to ask 1 simple questions. I aint moderator or somthn
    jst tellin u as friend.. hope that helped

    -Saif

  11. #11
    grand gamer99's Avatar
    grand gamer99 is offline Senior Member+
    Last Online
    8th July 2012 @ 01:45 PM
    Join Date
    26 Aug 2009
    Location
    Lahore
    Posts
    81
    Threads
    20
    Credits
    0
    Thanked
    4

    Default

    thanks a lot for the tip and the program

    saif bhai mujhe aik aur bat phochni thi

    request ye hai k app mujhe batadain ke c++ main kisi program ko gui main kese late hain i mean i can only make console programs can u tell me how to add gui

    for example meri stop watch ko aik gui program main comments deker batain aur mujhe ye bhi batayain k is ko pause karne key liay konsi comand use karon?

    Shukria
    Osama Akhter
    Last edited by grand gamer99; 20th November 2009 at 04:17 PM. Reason: wanted to add a request

  12. #12
    SufyanGujar is offline Senior Member+
    Last Online
    29th December 2010 @ 10:59 PM
    Join Date
    10 Oct 2009
    Location
    England, UK
    Age
    34
    Posts
    157
    Threads
    10
    Credits
    0
    Thanked
    7

    Default

    Quote grand gamer99 said: View Post
    thanks a lot for the tip and the program

    saif bhai mujhe aik aur bat phochni thi

    request ye hai k app mujhe batadain ke c++ main kisi program ko gui main kese late hain i mean i can only make console programs can u tell me how to add gui

    for example meri stop watch ko aik gui program main comments deker batain aur mujhe ye bhi batayain k is ko pause karne key liay konsi comand use karon?

    Shukria
    Osama Akhter
    U will need to learn alot more to do GUI in C++,
    u will need to pic some book or somethn that
    teach's u C++ GUI, or u can simply move to
    if u like GUI stuff u can simply move to Visual Basic,
    inst much different than C++, easy to learn and
    u will find loads of tut's on Visual Basic form etc

    U dont have to leave C++ if u dont want to
    Further on u will see that u can use both languages
    togeather, That is, u can code half of ur project in
    C++ and other half in Visual Basic and u can link em
    togeather and it will work,

    I dont do GUI programming in C++,
    as i am new learner myself, started
    about six months ago , still dont know
    advenced stuff..

    what u mean by pause? if u mean
    to pause screen to see time..
    U can use
    Code:
    system("PAUSE");
    -Saif

Page 1 of 6 1234 ... LastLast

Similar Threads

  1. Solved Q21. ITD Winner Rank Question (Final Question)
    By Afridi in forum ITDunya 18th Anniversary (8 Nov 2023)
    Replies: 9
    Last Post: 8th November 2011, 10:09 PM
  2. Solved c++ question
    By shamsgul in forum Solved Problems (IT)
    Replies: 17
    Last Post: 11th July 2011, 01:17 AM
  3. new game question with question..........
    By lucky shah in forum Baat cheet
    Replies: 12
    Last Post: 16th July 2010, 02:53 AM
  4. a little question
    By esr in forum Ask an Expert
    Replies: 8
    Last Post: 10th October 2008, 12:02 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •