Yes, that's the problem, I wonder why that happens.
Type: Posts; User: KneeLess
Yes, that's the problem, I wonder why that happens.
Yes, I want to quote the string, so I broke what i was doing into parts.
#include <stdio.h>
#include <windows.h>
int main(int argc, char **argv)
{
char str[1024];...
Running code like this, weird things happen:
char SBD_FULL_PATH[1024];
/* a ways down */
printf("SFP1: %s\n",SBD_FULL_PATH);
snprintf(SBD_FULL_PATH,sizeof(SBD_FULL_PATH),
...
Using the following code to turn an ip address into a number, it doesn't output the correct numbers.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <arpa/inet.h>
#include...
StackOverflow, thanks for the nice tutorial, but I'm positive I didn't overflow my boundries. Plus wouldn't allocating calloc to give me 4 chars overflow it the same if I changed nothing else?
I...
Is it bad practice (and programming) to use plain arrays in functions not unlike this?
char function(char *string)
{
char a[4]; /* Is this bad? */
/* etc... */
return a[whatever];
}...
I need to find a way to do a C++ Booleans in C, the way I've come up with so far is:
typedef enum { false, true } bool;
bool one = false;
Which works fine. But, I need to know if this takes up...
Hello. I'm trying to get into module programming, so I picked up both of the guides at the LDP. They were good guides, but for 2.4 or so I assume. I'm using 2.6 and whenever I insmod a module I...
This isn't a solution at all. For one, it's security by obscurity. Two, you can freely read the UID root from /etc/passwd. Three, if you restrict services to encrypted ones (like SSH) or tunnel them...
I would like to know exactly how sqrt() works. Either in assembly or C, doesn't matter. What I need it for, is for my Controller on our schools robot. It doesn't have any sqrt function, and I would...
Nevermind, fixed. Don't you hate that? Worked on it for 6 hours only to fix it in three minutes. :rolleyes:
Hello. As we all know, the distance formula is sqrt(sq(x2-x1) + sq(y2 - y1)). sq = square. Now, for some reason, this isn't at all working. Here is my code:
float distance(float x2, float y2)...
But fstream has cout/cin. Your right, iostream did work. But...nevermind, it works right?
Let's be nice to him. :)
Now I have very little knowledge of QBasic. Just enough for my QBasic class in school. :p. But I believe if you declare variables outside a SUB then it is global.
Like...
But aren't we all? :p
Some of the error messages:
--'cout' : undeclared identifier
--'<<' : illegal, right operand has type 'char [51]'
while(1)
{
cout << "Are you sure you want to encrypt this file (y/n)?...
As suggested by Cat...
I'm working on a simple XOR program (with some file i/o). It uses some include files. Here they are:
#include <cstdlib>
#include <fstream>
#include <cstring>
using...
Wow, I never knew that.
Thanks Cat. Well it looks like this now
#include <cstdlib>
#include <fstream>
#include <cstring>
using namespace std;
Yes, it does.
But whenever I use it in larger programs (more than one include), it throws errors at me..like this:
#include <stdlib>
#include <fstream>
#include <string>
using namespace...
Visual C++ 6 isn't good enough, what about Dev C++ 4? Yep, even Borland gives me the same error.
I still use .h. :p
Only because when I use
using namespace std;
It says there is no namespace std.
O_o
I believe I was treating them as text files unless I'm mistaken.
fstream FileE(argv[1], ios::in | ios::out | ios::nocreate);
Could I treat the text file as a binary file, and then...
I've heard C++ Primer 3rd Edition is an awesome book. I'm getting it soon for myself.
:)
Let's say I have this code block right here:
ch = ch ^ Password; // Encrypting...
That encrypts my ch. Now would this decrypt my ch (back to normal)?
ch = Password ^ ch; // Decrypting...
...
I don't really understand your question. You want to append data to the end, that is not touching the rest of the data, but you want the first line at the end? Huh?
Well I think your problem is:
...