I'm just starting out writing trying to write a simple program in C and I am using Visual Studios to do so. I heard that it does compile C as well as C++. And I know that it does because it says it compiles. The only problem is that when I go to the output directory, there isn't a .exe file in the directory! It has the following:
Build...
I know a question like this was already asked, but the situation is a little different, and all the answers on that problem didn't work for me.
I'm trying to compile some C code in VS2008 and it doesn't create an exe. Also, when I try to run it with f5, I get:
This application has failed to start
because MSVCR90.DLL was not found....
How can I pad a string with spaces on the left when using printf?
For example, I want to print "Hello" with 40 spaces preceding it.
Also, the string I want to print consists of multiple lines. Do I need to print each line separately?
EDIT: Just to be clear, I want exactly 40 spaces printed before every line.
...
What resources do you know dedicated to software development in C for PIC microcontrollers?
I would like to see some kind of framework that handles both IO (buttons for input and LCD for output) and application logic. You can think of it as a VERY simple OS. I understand that PIC's memory can be small for such frameworks so I think it c...
I'm looking for an open-source SGML parser written in plain C. This is to parse bona-fide SGML, not malformed stuff.
Any ideas?
...
Sorry for the newb question. I'm still learning programming. So I'm using C++, and I need to do something like this:
int n;
do {
n = get_data();
if(n != -1)
send(n);
} while(n != -1);
This is just a sketch. Anyway it doesn't feel real elegant. I have to have my test twice. I could just test once and set a flag, bu...
Here's a fun exercise.
http://www.hughchou.org/hugh/grid_game.cgi?CLEAR
Who can write the most elegant yet performant code to win this game? My solution is in C/C++.
#include<vector>
#include<iostream>
#include<fstream>
#define N 64
std::vector<int> numbers(N+1);
void init()
{
for(int i = 0; i < N+1; ++i)
numbers[i] = 1;
...
I've explored python for several years, but now I'm slowly learning how to work with c. Using the python documentation, I learned how to extend my python programs with some c, since this seemed like the logical way to start playing with it. My question now is how to distribute a program like this.
I suppose the heart of my question is...
In the application that I am working on, the logging facility makes use of sprintf to format the text that gets written to file. So, something like:
char buffer[512];
sprintf(buffer, ... );
This sometimes causes problems when the message that gets sent in becomes too big for the manually allocated buffer.
Is there a way to get sprint...
A program written in Visual C/C++ 2005/2008 might not compile with another compiler such as GNU C/C++ or vice-versa. For example when trying to reuse code, which uses windows.h, written for a particular compiler with another, what are the differences to be aware of?
Is there any information about how to produce code which is compatible ...
Hi everybody
I have finally got the green light to use Memcached in our project (after months of lobbying against a database-based caching solution - just don't ask...), however we will need to use Repcached as well to have backup copies of our data. Has anyone built this for Win32? We may end up using Linux in production, but develop...
We had a discussion here at work regarding why fread and fwrite take a size per member and count and return the number of members read/written rather than just taking a buffer and size. The only use for it we could come up with is if you want to read/write an array of structs which aren't evenly divisible by the platform alignment and he...
I am looking for a Windows based library which can be used for parsing a bunch of C files to list global and local variables. The global and local variables may be declared using typedef. The output (i.e. list of global and local variables) can then be used for post processing (e.g. replacing the variable names with a new name).
Is such...
Hello,
I have been recently (and repeatedly) asked by customers about MIPS needed to run our software. Usually we was able to get rid of this questions by explaining the customer that this is really depend on the cpu/os/hw (our software is highly portable) and/or use case (i.e. how our software is used).
But I have a last one not o...
I have a couple of hobby C programming projects that I would like to start. I am looking for an open source library that has a liberal license (I want credit, but pretty much anybody can use). The library needs to have strings better than the C standard library and some portable threading primitives.
I am considering GLib and APR. Wh...
What should I keep in mind when converting my projects from C to C++? Is there any reason to use C at all? The only thing in my mind now is to make sure it's friendly to DLLs so I can create a C interface if I need it.
Note: I know C++ just fine. Templates, partial specialization, why multiple inheritance is bad (I've only seen one prop...
I have a project consisting of two files, main.c and logoff.c. When I try to compile them I get this error:
gcc -c -g -Wall main.c
gcc -c -g -Wall logoff.c
gcc -o main -g -Wall main.o logoff.o
ld: duplicate symbol _logoff in logoff.o and main.o
I have a function named logoff in logoff.c, but I have searched main.c for the text "logoff...
To outline: I have a parser that grabs Cell references using the following regex
"$"?{letter}{1,2}"$"?{digit}{1,3}
I cant seem to find an elegant way to split the resulting char* into its row, and column components.
ex. split a1 into a and 1
or
split $aa$4 into fixed_col a fixed row 4
Any help is appreciated.
...
I'm leaning some win32 programming, and the WinMain prototype looks like:
int WINAPI WinMain ( HINSTANCE instance, HINSTANCE prev_instance, PSTR cmd_line, int cmd_show )
I was confused as to what this WINAPI identifier was for and found:
#define WINAPI __stdcall
What does this do? I'm confused by this having something at all ...
I'm making a C program where I need to get the directory that the program is started from. This program is written for UNIX computers. I've been looking at opendir() and telldir(), but telldir() returns a off_t (long int), so it really doesn't help me. How can I get the current path in a string (char array)?
...