Click here to Skip to main content
15,908,175 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A program running Pin
RomTibi29-Jan-07 2:19
RomTibi29-Jan-07 2:19 
GeneralRe: A program running Pin
CPallini29-Jan-07 9:10
mveCPallini29-Jan-07 9:10 
GeneralRe: A program running Pin
RomTibi30-Jan-07 20:34
RomTibi30-Jan-07 20:34 
GeneralRe: A program running Pin
Hamid_RT28-Jan-07 18:33
Hamid_RT28-Jan-07 18:33 
GeneralRe: A program running Pin
RomTibi29-Jan-07 2:14
RomTibi29-Jan-07 2:14 
GeneralRe: A program running Pin
Hamid_RT29-Jan-07 18:07
Hamid_RT29-Jan-07 18:07 
AnswerRe: A program running Pin
Mark Salsbery27-Jan-07 11:22
Mark Salsbery27-Jan-07 11:22 
GeneralRe: A program running Pin
Eytukan27-Jan-07 20:16
Eytukan27-Jan-07 20:16 
GeneralRe: A program running Pin
RomTibi27-Jan-07 20:28
RomTibi27-Jan-07 20:28 
GeneralRe: A program running Pin
#realJSOP28-Jan-07 0:44
professional#realJSOP28-Jan-07 0:44 
GeneralRe: A program running Pin
Mark Salsbery28-Jan-07 6:43
Mark Salsbery28-Jan-07 6:43 
GeneralRe: A program running Pin
RomTibi29-Jan-07 2:23
RomTibi29-Jan-07 2:23 
GeneralRe: A program running Pin
Mark Salsbery29-Jan-07 6:31
Mark Salsbery29-Jan-07 6:31 
GeneralRe: A program running Pin
RomTibi29-Jan-07 9:35
RomTibi29-Jan-07 9:35 
GeneralRe: A program running Pin
Mark Salsbery29-Jan-07 11:02
Mark Salsbery29-Jan-07 11:02 
AnswerRe: A program running Pin
PJ Arends27-Jan-07 12:06
professionalPJ Arends27-Jan-07 12:06 
GeneralRe: A program running Pin
RomTibi27-Jan-07 20:29
RomTibi27-Jan-07 20:29 
AnswerRe: A program running Pin
Hamid_RT27-Jan-07 18:52
Hamid_RT27-Jan-07 18:52 
GeneralRe: A program running Pin
RomTibi27-Jan-07 20:29
RomTibi27-Jan-07 20:29 
AnswerRe: A program running Pin
Stephen Hewitt28-Jan-07 13:57
Stephen Hewitt28-Jan-07 13:57 
GeneralRe: A program running Pin
RomTibi29-Jan-07 2:15
RomTibi29-Jan-07 2:15 
QuestionTrying something new Pin
dellthinker27-Jan-07 7:37
dellthinker27-Jan-07 7:37 
Hi all. Im trying something new. Something yesterday gave me an idea that i could use it with more than one source file. So i created 2 source files and 1 header file to do all the including and bridging communication between sources.

Here's what i have so far.

Source 1
<br />
#include "include.h"<br />
<br />
int main(){<br />
	const SIZE = 100;<br />
	char msg[SIZE];<br />
	printf("Enter a file you'd like to read: ");<br />
	cin.getline(msg,SIZE);<br />
	if(!msg){<br />
		printf("File %s doesnt exist.\n",msg);<br />
	}<br />
	else{<br />
		printf("Reading file %s",msg);<br />
		readfile();<br />
	}<br />
	return 0;<br />
}<br />


Source 2
<br />
#include "include.h"<br />
<br />
void readfile(void){<br />
	char buffer[100]={'\0'};<br />
	ifstream file("test.txt");<br />
	while(file.getline(buffer, 100)){<br />
			Sleep(3000);<br />
			printf("%s\n",buffer);<br />
	}<br />
	file.close();<br />
	cin.get();<br />
} <br />


Source 1 is to check what type of file you want to read. And determines if its in the area or not. Then source 2 actually does the reading once source1 gives it the O.K. - But im getting errors like mad.

<br />
: error C2513: 'const struct tagSIZE' : no variable declared before '='<br />
: error C2275: 'SIZE' : illegal use of this type as an expression<br />
: see declaration of 'SIZE'<br />
: error C2057: expected constant expression<br />
: error C2466: cannot allocate an array of constant size <br />
: error C2133: 'msg' : unknown size<br />
: error C2275: 'SIZE' : illegal use of this type as an expression<br />
  : see declaration of 'SIZE'<br />


If i compile them individually they work fine. But together they seem not to like each other. How do i fix this? Thanx in advance.
AnswerRe: Trying something new Pin
Michael Dunn27-Jan-07 8:26
sitebuilderMichael Dunn27-Jan-07 8:26 
AnswerRe: Trying something new Pin
prasad_som27-Jan-07 17:41
prasad_som27-Jan-07 17:41 
Questionhow to execute other progams in c++ Pin
asp.netProgrammer27-Jan-07 6:47
asp.netProgrammer27-Jan-07 6:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.