Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8183841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:17:33+00:00 2026-06-07T01:17:33+00:00

I have a simple C program that I can compile via command line on

  • 0

I have a simple C program that I can compile via command line on Linux easily enough but want to use Visual Studio to debug the program so that I can more easily see what it’s doing but I cannot get it to compile.

I have created a new cpp Win32 console application. Added my .c and .h file but I cannot get it to compile. I get 100+ errors that primarily seem to be red herrings. For instance I have an error saying a variable isn’t declared when I can see it declared on the line immediately before. For instance:

int i;
for (i = 0; i < unpacked_length; i++)
{

on the “for” line I get an error: “error C2065: ‘i’ : undeclared identifier”

So something else is obviously going on. One error that seems legit is this one:

static unsigned char* Base64_Charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

IntelliSense: a value of type “const char *” cannot be used to initialize an entity of type “unsigned char *”

Since this works when compiling via command line I don’t know why the intellisense would be giving this error here unless this compiler has different rules than the other one I used via command line. I haven’t done any C for about 15 years and don’t know if this could be a difference in compiler or if there is something else going on here.

The only includes in the source are:

#include "dtcrypt.h"
#include <string.h>
#include <stdlib.h>

Appreciate any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T01:17:35+00:00Added an answer on June 7, 2026 at 1:17 am

    Visual Studio 2010 only supports ANSI C (aka C89), it does not support the more modern C99 or C11 language standards. ANSI C requires you to declare all of your variables at the top of a function, you cannot define them in the middle of a function just before they are used. So try rewriting your code like this:

    void my_function()
    {
        /* Variable declarations go here */
        int i;
        ...
    
        /* Now teh codez */
        for (i = 0; i < unpacked_length; i++)
        {
            ...
        }
    }
    

    For the second error, Intellisense complaining that it can’t convert a pointer to const char to a pointer to const unsigned char. String literals have type char[] (array of characters), and char is signed by default. So, you should declare your variable as type const char * instead of const unsigned char *. Or, you can ignore it, since it’s not a compiler error, but it is a warning at certain warning levels.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple C++ program that I can compile (g++ from command line)
I have a reasonably simple C++ program that I can successfully compile on OSX
I have a very simple example program that I am trying to compile, but
I have written a simple OpenGL program in C++ that displays a line joining
Say I have simple program that emulates a board game with a number of
I have a simple program that checks webpages for strings, example: Private Sub Button1_Click(ByVal
I have this simple program that computes salaries for four different worker types. It's
I have a simple program that creates a thread, loops twenty times and then
I have a simple program that reads data from a PNG into a 2D
I have a simple python program that I'd like to daemonize. Since the point

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.