Search:

Type: Posts; User: vart

Page 1 of 20 1 2 3 4

Search: Search took 0.15 seconds; generated 1 minute(s) ago.

  1. Replies
    7
    Views
    2,680

    For simple types it is not so important, but for...

    For simple types it is not so important, but for classes it could make a great difference - so it may be good to get into habit from the begging - prefer op= like a *= b to the a = a * b

    for...
  2. Replies
    7
    Views
    2,680

    In addition to the above pay attention to the...

    In addition to the above pay attention to the type conversions. For example your balance variable is double, but calBalance function is returning int.
  3. Replies
    2
    Views
    4,495

    And use some autoformatter - it will help you to...

    And use some autoformatter - it will help you to find problems in your code



    #include <stdio.h>

    float askprice();
    float addtax();
    void printtotal(float total);
  4. It still the statement - not a question. So...

    It still the statement - not a question.

    So instead of answer - I have 2 comments:

    1. system is not a portable solution so while it can work in one environment do not expect it to work in...
  5. Do you have a question hidden somewhere in your...

    Do you have a question hidden somewhere in your post?
  6. %*lf will skip the number in the input stream ...

    %*lf will skip the number in the input stream

    %lf will read a number into double variable (passed by pointer)

    You have 3 %*lf and 2 %lf - it means you expect to have 5 double values and read 2...
  7. Replies
    5
    Views
    2,075

    No Salem means move your condition from while...

    No Salem means move your condition from while into loop body



    while(fgets(buf,sizeof buf, stdin)== NULL ||
    sscanf(buf,"%d%n",&value,&end)!=1||
    !isspace(buf[end]))
    ...
  8. src/test.cpp:17:53: error: format ‘%lf’ expects a...

    src/test.cpp:17:53: error: format ‘%lf’ expects a matching ‘double*’ argument [-Werror=format=]
    src/test.cpp:17:53: error: format ‘%lf’ expects a matching ‘double*’ argument [-Werror=format=]

    You...
  9. To make this code fine - need to check return...

    To make this code fine - need to check return value of scanf before using any variable it filled. And also there is library function for converting to upper case that works even if the encoding...
  10. Replies
    2
    Views
    4,421

    How old is your book? This code will not be...

    How old is your book? This code will not be compiled by any decent recent compiler



    #include<stdio.h>

    int add(p,q);
    int sub(p,q);

    int main() {
  11. You have to skip \n that was not read by [^\n]...

    You have to skip \n that was not read by [^\n] format to go to the next line


    #include<stdio.h>

    int main() {
    char read_word[500];
    int res;
    int read =0;
    while((res =...
  12. Trying to delete

    Trying to delete
  13. Replies
    3
    Views
    3,509

    I would not say never... Looking at the new C++...

    I would not say never... Looking at the new C++ which now includes <filesystem> or <thread>... Several years ago somebody would also say it will be never part of the standard since this...
  14. You also have to add declaration of add_Func...

    You also have to add declaration of add_Func before you call it


    /* A simple C program that takes
    * two values and invoke a function with
    * pass by value */


    # include <stdio.h>
    # include...
  15. KeyVal.real not real.KeyVal ...

    KeyVal.real not real.KeyVal



    #include<iostream>
    using std::cout;
    using std::endl;

    template <class t>
    //neq (t t1,t t2);
  16. On windows I would recommend VS2017 Community...

    On windows I would recommend VS2017 Community edition
  17. For windows - download free version of VS2017 ...

    For windows - download free version of VS2017

    Downloads | IDE, Code, & Team Foundation Server | Visual Studio

    And choose Community Edition
  18. What would be strange? //Program in C /*...

    What would be strange?



    //Program in C
    /* Using strchr() & strcmp()
    * function(s) to do some conditional(s) */


    #include <string.h>
  19. perror shows value of errno. Since no error...

    perror shows value of errno. Since no error actually occurred - errno is 0. This is what is being printed
  20. I'm not listening to audio books I'm using TTS...

    I'm not listening to audio books
    I'm using TTS engine to listen to regular e-books. For Sumsung engine - the quality is good for years. Google in the Android 7 has improved its engine dramatically....
  21. Thread: Function Call

    by vart
    Replies
    2
    Views
    2,099

    Seems to me this error has nothing to do with the...

    Seems to me this error has nothing to do with the code. More likely - your exe is still in the memory (still running or being debugged)
    Try to delete Main2.exe before trying to compile to see if...
  22. I feel like you have to choose different book for...

    I feel like you have to choose different book for Jumping into C++

    Looking at this sample I not really sure that C++ is what you will be learning with it.

    you should not declare the var without...
  23. Replies
    2
    Views
    11,027

    you do not want to combine interfaces and...

    you do not want to combine interfaces and implementation classes in the same file
    user of your class only interested in the interface - so this is what he should be able to see
    your class could...
  24. instead of matching size to the type in the...

    instead of matching size to the type in the struct you can just use the size of variable you are reading (assuming as was said - read and write are performed by same compiler settings build exe)

    ...
  25. Replies
    1
    Views
    2,870

    I stopped reading on the line 5 From the manual...

    I stopped reading on the line 5
    From the manual for inet_pton

    since your addrOut is uninitialized - this call should crash.

    Do you really have some working code you are trying to modify?
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4