Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.27 seconds.

  1. Replies
    3
    Views
    68

    Well which compiler / IDE are you using?

    Well which compiler / IDE are you using?
  2. Replies
    3
    Views
    68

    1, indentation really helps to see what's going...

    1, indentation really helps to see what's going on.


    #include <stdio.h>
    #include <stdlib.h>

    int main()
    {
    int Option, ResCount, Resistors, ResValue, ResTotal;
    ResCount = 0;
  3. Yeah, 500 lines of poorly formatted code...

    Yeah, 500 lines of poorly formatted code containing goto's is not a good start.

    You have a lot of printf's in there, perhaps you could post those as well.
    Bear in mind that either we can't run...
  4. You need to return the new length of the array,...

    You need to return the new length of the array, after you've removed the duplicates.
  5. > Enter the number of digits : 4 Presumably, you...

    > Enter the number of digits : 4
    Presumably, you used scanf with %d to read this.

    > Enter the number in binaries : 1001
    What did you use to read this?

    One you have a sequence of 0 and 1, then...
  6. > Always a good idea to give a hand to the...

    > Always a good idea to give a hand to the compiler,
    Or a bad idea.

    If you write overly micro-managed "efficient" code, you typically subvert the ability of the optimiser to see through your...
  7. Replies
    1
    Views
    69

    > direction += rotation; > double ax =...

    > direction += rotation;
    > double ax = acceleration * cos(direction);
    > double ay = acceleration * sin(direction);
    The first question to ask would be what units your angles are measured...
  8. > for example L = [3, 2, 7, 5, 8] > if I wanna...

    > for example L = [3, 2, 7, 5, 8]
    > if I wanna find successor for 3 it has to be bigger than 3 but smaller than other numbers which is 5.
    The question is only meaningful if the list is sorted.
    ...
  9. Thread: Student database

    by Salem
    Replies
    10
    Views
    269

    > sum_age = sum + list[i].age; Where is this...

    > sum_age = sum + list[i].age;
    Where is this declared in your code?
    At best, it's some messy global variable.
    At worst, it's undeclared and your code doesn't even compile.



    void...
  10. Thread: Student database

    by Salem
    Replies
    10
    Views
    269

    > int sum_age; What is the initial value of...

    > int sum_age;
    What is the initial value of sum_age?

    > sum_age = sum + list[i].age;
    What is sum here?
    Where did you declare it?
  11. Thread: Student database

    by Salem
    Replies
    10
    Views
    269

    > if(list[i].gender == male) Use strcmp() to...

    > if(list[i].gender == male)
    Use strcmp() to compare strings.
  12. #define FALSE 0u #define TRUE (~FALSE) TRUE...

    #define FALSE 0u
    #define TRUE (~FALSE)

    TRUE becomes all bits set in whatever width of data type you end up assigning it to.
  13. Thread: Student database

    by Salem
    Replies
    10
    Views
    269

    Regarding delete void Delete(personaData...

    Regarding delete


    void Delete(personaData list[50], int x)
    {
    int pnum;
    printf("Enter a personal number:");
    scanf("%d", pnum);
    char emptyStr[20] = {"\0"};
    int...
  14. A for loop with a[i] = -a[i]; perhaps?

    A for loop with a[i] = -a[i]; perhaps?
  15. > printf("%d\n", &length); // prints 6422272 ...

    > printf("%d\n", &length); // prints 6422272
    Because you don't use & when printing a value.

    > for(i = 0; i <= length; i++)
    Arrays run from 0 to length-1
    So we usually say
    for(i = 0; i <...
  16. Which compiler / IDE are you using? If you're...

    Which compiler / IDE are you using?

    If you're compiling from the command line, all you need is
    g++ main.cpp operator.cpp
  17. So, do you have any code to start with? Just...

    So, do you have any code to start with?

    Just dumping your assignment on us with zero effort isn't good.
  18. Thread: Programm C fix

    by Salem
    Replies
    5
    Views
    283

    > On the Y axis the temperature should appear and...

    > On the Y axis the temperature should appear and on the X axis the 100 steps.
    So you should only be outputting pairs of numbers to begin with.

    Using strtok is messy, because you also need to...
  19. Replies
    4
    Views
    263

    > There is no operator present. But in the...

    > There is no operator present.
    But in the context of an expression requiring a boolean expression,
    while(numbers[ball])
    is the same as
    while(numbers[ball] != 0)

    Since you then go onto do...
  20. Thread: Tricky typedef

    by Salem
    Replies
    5
    Views
    280

    Do you have some context for the question? >...

    Do you have some context for the question?

    > What can be the usage of this?
    Typedef'ing a function pointer is very common.

    Primarily because they're quite complicated to get right, and they...
  21. Thread: Tricky typedef

    by Salem
    Replies
    5
    Views
    280

    cdecl: C gibberish English...

    cdecl: C gibberish <-> English
    It's a function pointer.
  22. Replies
    11
    Views
    584

    Moved to right forum.

    Moved to right forum.
  23. Replies
    11
    Views
    584

    Copy and paste your code between tags. A...

    Copy and paste your code between
    tags.

    A fuzzy picture of barely legible text just doesn't cut it.
  24. Since you mentioned visual studio, I'll assume...

    Since you mentioned visual studio, I'll assume your OS is windows.

    If you're writing a GUI program, start here
    Keyboard Input (Get Started with Win32 and C++) - Win32 apps | Microsoft Docs
    Using...
  25. Thread: C program help

    by Salem
    Replies
    1
    Views
    188

    OK, so what vague ideas do you have, so we can...

    OK, so what vague ideas do you have, so we can help you make them less vague.
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4