Hi,
It seems like I have a pointer problem...
Here is my code:
I declare a global char pointer in a .h file:
char * output_dir;
then in the main I print that dir:
cout << output_dir << end;
cout << &output_dir << end;
cout << output_dir << end;
The output is...
Hello,
The output file string does not seem to change:
Output file before: F:\code\practice_code\Input_GUI_dynamic\output
Output file after: F:\code\practice_code\Input_GUI_dynamic\output
Any ideas?
Thanks!
I declare the variables globally in a .h file:
/* files and directories */
const char * output_dir;
const char * perfusion_file;
My “file_name” is actually called “perfusion_file”. In my main program I have:
int main(int argc, char** argv)
{
assign_vars(argc, argv); // assigns variables...
Hi, I've got a problem with my mkdir function. After I call mkdir a string called "file_name" gets altered.
Do you have any idea what is going on?
cout << file_name << "\n"; // name displayed
mkdir(output_dir);
cout << file_name << "\n"; // name not displayed
Thank you!
Hello,
I'm trying to execute a bunch of threads in the inner loop but only one batch of inner threads at a time. How do I stop the outer loop until the inner loop threads finish running?
Thanks in advance!
Outline:
outer
{
not concurrent
inner{
executes
concurrent threads
}
}
Hi, I'm writing some basic client server socket programs transferring multiple files from the server to the client. How do I keep the client's socket open so that multiple files go through that one socket?
Thanks in advance!
Hi, I want to know how to figure out how long it takes for my program to run. I need a timestamp at the beginning and the end in order to find the total run time. Does anybody know of a class that I could use?
Thanks
Hello,
does anyone know of any online resource where I can learn about c version internet socket programming? There are some very elementary ones online, but I would like to get some more indepth material.
Thanks!
Oh, when i try to make to run the main C++ file with the function prototype from the C file inluded as a header file, the following error pops up:
c:\visualc++\udpclient1\macaddress.c(56) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Error...
Hi, I've got a c program that cannot be saved as a c++ file. When I try to save it as C++, there are several compile errors.
Anyways, I need to get the results from this C program and transfer what it returns to another C++ program.
How are you supposed to link and run everything??
I'd...
Thank you for the help, but i have more problems...
I need to write my data into 3 output files while
the data is output with functions, (which are in the global scope).
The problems are:
1. I do not know how to use old C syntax and output to multiple files at once.
2. I do not know how...
Hi!
I can't figure out how to save the current OS date into the name of the output file. For example, if i run the program now, i want the output to be printed into a file called something like "Statistics_April4.txt".
This is what i've tried, but i keep on getting errors.
Please...
I'm not sure if this helps... you can get the time from the os by using this:
#include <math.h>
#include <conio.h>
#include <iomanip>
#include <fstream>
#include <iostream>
#include <string>
#include <stdio.h>
#include <vector>
#include <stdlib.h>
#include <assert.h>
#include <time.h>
using...
Hello!
I'm running a very long simulation program which runs for about an hour and then suddenly stops. I am suspecting that i have a memory leak but i cannot find it. Are there any programs that i could download which could track memory leaks??
Thanks.
Thank you for all your help! After a long time i finally figured out that i made 2 errors:
i should have put <iostream> and <iomanip> instead of <iostream.h> and <iomanip.h>
I've been using Borland 5.0, and am trying to use Visual C++ 6.0.
outputting a string in borland is fine but i can't seem to cout strings in visual. Am i missing an include file??
This is what i've included:
#include <math.h>
#include <conio.h>
#include <iomanip.h>
#include <fstream.h>...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.