vividexstance's Profile User Rating: *****

Reputation: 750 Master
Group:
Expert
Active Posts:
2,652 (1.65 per day)
Joined:
31-December 10
Profile Views:
14,844
Last Active:
User is offline Today, 10:23 AM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Linux
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
0
Expert In:
C/C++

Latest Visitors

Icon   vividexstance has not set their status

Posts I've Made

  1. In Topic: GUI programming

    Posted 27 May 2015

    Qt is nice because it's cross-platform. There are many GUI libraries you can use in Linux, like GTK or GTKmm (the C++ version of GTK).
  2. In Topic: How do I fix my grade program?

    Posted 26 May 2015

    View Postjimblumberg, on 26 May 2015 - 02:34 PM, said:

    Good point, the next if statement should be print it's message.

    Jim

    Or the OP could just make the first check a greater-than-or-equal to 100.
  3. In Topic: How do I fix my grade program?

    Posted 26 May 2015

    What if, somehow, the grade is more than 100?

    Is there a reason you're using a float? Why not an int?
  4. In Topic: Reading math expression

    Posted 26 May 2015

    If you want to convert the character/string to integers, it's not difficult to do it yourself.

    If you know the character array/C-style string you have contains only digits, then you just have to loop through the string, and subtract '0' from each character:
    char num = '7';
    int digit = num - '0';
    
    printf("num = '%c', digit = %d\n", num, digit);
    printf("num + 3 = %d\n", digit + 3);
    
    

    That would print:

    Quote

    num = '7', digit = 7
    num + 3 = 10

    The reason this works is that a char is simply an integer that represents a specific character in the ASCII table.

    By subtracting '0' from whatever digit character num contains, you're going to get a number between 0-9, if num only contains a digit character.

    So depending on the digit character num holds, it could be between 48 and 57. The '0' is 48 and '9' is 57.

    If you do the math out for whatever digit num can hold, it will be the conversion of that digit character to a single-digit integer value.

    *EDIT*:
    The above isn't bad for learning, but instead you can use either sscanf() like you said, or you could try snprintf(), which works in a similar way.

    Using snprint(), you would be able to input an integer from the user/file, then convert it to a C-style string using that function. This way, you don't need to check to make sure it's a number or not.
  5. In Topic: delete update problems

    Posted 26 May 2015

    It would help if you tell us what's going on?

    For example, are you getting compiler warnings/errors?
    If so, what are they and where are they (the line number)?

    If the program compiles, then what input are you giving the program?

    Also, what is the expected output and the actual output?

My Information

Member Title:
D.I.C Lover
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Programming Languages:
C, C++, Python

Contact Information

E-mail:
Click here to e-mail me
MSN:
MSN  vividexstance@hotmail.com

Comments

Page 1 of 1
  1. Photo

    orihotomihsah Icon

    09 Sep 2013 - 09:45
    Hi
Page 1 of 1