The following is a extremely easy c++ program, but the output is incorrect. Please help:
=============================output=====================
??22
pt2[0]: g str[21]: g
pt2[1]: n ...
Type: Posts; User: sharonch
The following is a extremely easy c++ program, but the output is incorrect. Please help:
=============================output=====================
??22
pt2[0]: g str[21]: g
pt2[1]: n ...
The following code doesn't give me any problem in Linux. But it is not that case when I run it in Mac OS 10.8.
I am wondering if I have done something wring about redirect the stderr and...
I know what is wrong. It is in the Makefile.
I run
vncstudent: vncstudent.c pprint.c
gcc -o vncstudent vncstudent.c pprint.c -I.
The program run. Is it the linkage issue for...
I did!
I place
extern char HDIR[20];
char HDIR[20];
to vncstudent.h
and now it is not complain about HDIR.
But did I do anything wrong with pprint()?
I didn't paste the header file which is where I place those library, but I still have question:
#include "vncstudent.h"
#include <unistd.h>
#include <string.h>
int main()
{
#include "vncstudent.h"
#include "pprint.c"
char HOMEDIR[20];
int main()
{
extern char HOMEDIR[];
padd();
pprint();
I want to rewrite a code to windows
In Unix setting, I use a FILE pointer and open the pipe to run the forced command. It is like the following:
#define cmd
"ssh -i /home/keys/student...
Yes! It is working. Thanks a lot. I want to check if I am right: the WinAPI that correspond to system() is WinExec(). But it didn't work in my program. I include <Windows.h> and <WinBase.h>,...
Hmmm, I tried, it didn't work. I still think the problem is in the "space" instead of "\".
system("xcopy password.ini C:\Program Files\OpenSLP /i /y");
Because it treats the C:\Program Files as...
Do you have any good suggestion of using \?
This is a very simple question, but it is just hard for me to figure out. I try to move a file from my folder to a program files subfolder, but I think the cmd in windows take the space between...
Wow! Thank you all. They are all constructive to my code! Thanks.
I was thinking to have my program print its directory to a file and then
system("cd") >> "ok.txt";
read from "ok.txt" to retrieve the current working directory, but it is a bit complicated.
...
Hi,
I have a question about developing a c program. I wrote my program in linux machine using emacs. Now, I have to make it works on windows machine(xp). I know I probably can rewrite the whole...
I really not sure if I can post this here, but I need some help!
I am using tomcat7 on Ubuntu VM. I wrote a Perl CGI to receive users' input and pass those input to my c program in the server. ...
Thanks for all the meaningful replies. I solved all of the problems that I have asked earlier. I would like to recap what happen:
1. correct warning. Since a lot of warning I have are not as...
Yes, I am trying to copy the entire public key into the variable "content". and paste the "line" in the beginning of the new public key then append the content after "line". now, it is working with...
Please allow me to answer my own question. After testing things for times. I figure that the fopen didn't go to the directory that I am working with to open that particular file. That is why it is...
It compiled. Your statement is not true.
I think I have correct the warning. No segmentation faults, but now the "line" and "content" is not writing to where it suppose to.
#include <stdio.h>
int main()
{
getKey();
return0;...
I can see why you say that for the line 27 and 28, but I think it is the only way for me to paste those info into a file.
although the % is going to messup my program, I went into the lastfirst.pub...
Something weird happened. I am running this code from a different directory and it is giving me segmentation fault again. Is it mean that I can't change directory in the system()?
#include...
Yes, system is working. Thank Salem.
Ok,
I see the problem. It is a logic issue. The public key is not generated until the program finish. Therefore, it can't read or write while the file is not ready yet.
To encourage a positive discussion, I want to clean up my code a bit. I think the major issue is in fget() and I don't know what is wrong.
int main()
{
getKey();
return 0;
}