Function converting from 1-7 for days of the week to actual strings

This is a discussion on Function converting from 1-7 for days of the week to actual strings within the C Programming forums, part of the General Programming Boards category; Hmm. I tried it just now (with gcc) and got a warning: [Warning] assignment discards qualifiers from pointer target type ...

  1. #46
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Hmm. I tried it just now (with gcc) and got a warning:
    [Warning] assignment discards qualifiers from pointer target type
    but it worked fine. Maybe losing the const in front of the function declaration, or declaring dow as const char *?

  2. #47
    Registered User
    Join Date
    Jul 2004
    Posts
    222
    So far, I managed to get things working if I made sure every variable that deals with the return type of the day of the week is in char* instead of const char*.

  3. #48
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,033
    Umm. Post your code.
    I smell something fishy and dangerous.
    If you used some of the same code posted here, that is.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Page 4 of 4 FirstFirst 1234
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 05-13-2011, 09:28 AM
  2. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 09:18 PM
  3. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  4. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  5. Programming using strings
    By jlu0418 in forum C++ Programming
    Replies: 5
    Last Post: 11-26-2006, 08:07 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21