Click here to Skip to main content
15,888,072 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralHelp!!! The strange problem! Pin
kcynic8-Apr-05 20:49
kcynic8-Apr-05 20:49 
GeneralRe: Help!!! The strange problem! Pin
Alexander M.,9-Apr-05 8:07
Alexander M.,9-Apr-05 8:07 
GeneralRe: Help!!! The strange problem! Pin
kcynic9-Apr-05 18:54
kcynic9-Apr-05 18:54 
GeneralRe: Help!!! The strange problem! Pin
mark novak10-Apr-05 4:07
mark novak10-Apr-05 4:07 
GeneralUsing output from a dos type program as input... Pin
RobJones8-Apr-05 18:23
RobJones8-Apr-05 18:23 
GeneralRe: Using output from a dos type program as input... Pin
Indivara8-Apr-05 19:10
professionalIndivara8-Apr-05 19:10 
General2D memory allocation Pin
RobertFavier8-Apr-05 14:52
RobertFavier8-Apr-05 14:52 
GeneralRe: 2D memory allocation Pin
mark novak9-Apr-05 6:00
mark novak9-Apr-05 6:00 
What error are you getting? This compiles cleanly and works under VC++ 7.1. Observe:
<br />
#include "stdafx.h"<br />
#include <iostream><br />
#include <conio.h><br />
<br />
int _tmain(int argc, _TCHAR* argv[])<br />
{<br />
	const int block_count = 12;<br />
	const int float_count = 4;<br />
<br />
	float (*tmp)[float_count] = (float (*)[float_count]) <br />
		calloc(block_count, float_count * sizeof(float));<br />
	if(!tmp)<br />
	{<br />
		std::cout << "calloc failed";<br />
		char c = getch();<br />
		return 1;<br />
	}<br />
<br />
	float counter = 0;<br />
	for(int n = 0; n < block_count; n++)<br />
	{<br />
		for(int nn = 0; nn < float_count; nn++)<br />
		{<br />
			tmp[n][nn] = counter;<br />
			counter += 1.0;<br />
		}<br />
	}<br />
<br />
	for(int n = 0; n < block_count; n++)<br />
	{<br />
		for(int nn = 0; nn < float_count; nn++)<br />
		{<br />
			std::cout << tmp[n][nn] << std::endl;<br />
		}<br />
	}<br />
<br />
	char c = getch();<br />
	return 0;<br />
}


Prints from 0 to 47.
GeneralRe: 2D memory allocation Pin
RobertFavier11-Apr-05 10:25
RobertFavier11-Apr-05 10:25 
QuestionHow to write out the points to rectangles to the view/screen? Pin
Håvar8-Apr-05 13:48
Håvar8-Apr-05 13:48 
AnswerRe: How to write out the points to rectangles to the view/screen? Pin
mark novak10-Apr-05 4:11
mark novak10-Apr-05 4:11 
AnswerRe: How to write out the points to rectangles to the view/screen? Pin
John R. Shaw10-Apr-05 10:37
John R. Shaw10-Apr-05 10:37 
GeneralDate time control Pin
The Professor8-Apr-05 12:40
The Professor8-Apr-05 12:40 
GeneralRe: Date time control Pin
mark novak9-Apr-05 5:19
mark novak9-Apr-05 5:19 
GeneralRe: Date time control Pin
The Professor9-Apr-05 12:56
The Professor9-Apr-05 12:56 
GeneralProcess handling Pin
mpapeo8-Apr-05 11:03
mpapeo8-Apr-05 11:03 
GeneralRe: Process handling Pin
mark novak9-Apr-05 5:44
mark novak9-Apr-05 5:44 
GeneralRe: Process handling Pin
mpapeo9-Apr-05 10:59
mpapeo9-Apr-05 10:59 
GeneralRe: Process handling Pin
mark novak10-Apr-05 3:57
mark novak10-Apr-05 3:57 
GeneralRe: Process handling Pin
mpapeo10-Apr-05 6:05
mpapeo10-Apr-05 6:05 
GeneralCollect rows from an external SQL Server from my MFC-app Pin
anderslundsgard8-Apr-05 10:15
anderslundsgard8-Apr-05 10:15 
GeneralCString to Integer Pin
Anonymous8-Apr-05 9:29
Anonymous8-Apr-05 9:29 
GeneralRe: CString to Integer Pin
Chris Losinger8-Apr-05 9:41
professionalChris Losinger8-Apr-05 9:41 
GeneralRe: CString to Integer Pin
Joel Holdsworth8-Apr-05 11:57
Joel Holdsworth8-Apr-05 11:57 
GeneralRe: CString to Integer Pin
deldeep9-Apr-05 2:52
deldeep9-Apr-05 2:52 

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.