|
What is the function that can be used to clear the data in the list box to display new data?
--Star
|
|
|
|
|
|
|
led mike wrote: They hide that information in the documentation[^]
Mean bastards.
Shog on learning VB6: Ah, that would have been VB6. Kicked my ass anyway. So easy to learn, just like falling down a flight of stairs...
|
|
|
|
|
|
Hi all:
I am supposed to extract the following string "cosc.exe" from a longer string "C:Program Files/Local_user/Visual Studio 2005/Project/Debugger/cosc.exe"
But I am not really sure how I am going to do it.
Can anyone help?
Thank you
|
|
|
|
|
What string class are you using ? Are you using MFC ? Are you using std::string ? Are you just using C ( that is, are you using char * to store a string ) ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi:
Thank you for your reply.
I am using std::string, C++.
|
|
|
|
|
Your slashes are backwards
"C:Program Files/Local_user/Visual Studio 2005/Project/Debugger/cosc.exe"
should be
"C:Program Files\Local_user\Visual Studio 2005\Project\Debugger\cosc.exe"
/////////////////////////
std::string sPath="C:Program Files\\Local_user\\Visual Studio 2005\\Project\\Debugger\\cosc.exe";
std::string sSearch="cosc.exe";
// If looking for the string directly
int nIndex=sPath.find(sSearch);
TRACE("Found \"%s\" at index = %d\n",sSearch.c_str(),nIndex);
/*
If you need to search out the filename
from a given path
*/
nIndex=sPath.rfind("\\");
std::string sExtract=sPath.substr(nIndex+1,sPath.length()-nIndex);
TRACE("Found '\\' at index = %d\n",nIndex);
TRACE("Filename from path is \"%s\"\n",sExtract.c_str());
|
|
|
|
|
Hi:
Thank you very much for your help. I really appreciate it.
Thank you
|
|
|
|
|
// Console.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <shlwapi.h>
#pragma comment(lib, "shlwapi.lib")
int main(int arvc, char* argv[])
{
LPCTSTR pFileName = PathFindFileName("C:Program Files/Local_user/Visual Studio 2005/Project/Debugger/cosc.exe");
std::cout << pFileName << std::endl;
return 0;
}
Steve
|
|
|
|
|
i get this error :
error C2664: 'new_array' : cannot convert parameter 3 from 'double (*)[10][2]' to 'double *[][2]'
do i type the Array wrong ?
<code>
code:
void find_values( long p[] ,int nCount ,double *pmid , double *ps);
void new_array(long p[] , int nCount , double *dp[][2]);
void print_array2( double p[][2] , int fCount);
int main()
{
double dp[N][2];
new_array(pinakas ,N ,&dp);
print_array2( dp , N);
}
void find_values(long p[] ,int nCount , double *pmid , double *ps)
{
double mid , s;
mid =0;
s = 0;
for ( int i =0 ; i < nCount ; i++ )
{
mid = mid + p[i];
}
mid = (mid/nCount);
for (int z = 0 ; z < nCount ; z++)
{
s = s + (p[z] - mid)*(p[z] -mid);
}
s = pow((s/(nCount -1)) , (1/2));
*pmid = mid;
*ps = s;
}
void new_array(long p[] , int nCount , double *dp[][2])
{
double min , s;
find_values( p,nCount ,&min , &s);
for (int i = 0 ; i < nCount ; i++)
{
*dp[i][1] = p[i];
if ( p[i] > min )
{
if ( p[i]*0.85 > min)
{
*dp[i][2] = p[i]*0.85 ;
}
else
{
*dp[i][2] = p[i];
}
}
else
{
if (p[i]*1.15 <min)
{
*dp[i][2] = p[i]*1.15;
}
else
{
*dp[i][2] = p[i];
}
}
}
} </code>
-- modified at 5:48 Sunday 20th May, 2007
|
|
|
|
|
how i put my code in the site like quote ? (so it can take the tabs that has in Visual studio Eviroment)
if( x == y )
{
y = x ;//used spaces
}
and not
if ( x ==y)
{
y=x;
}
or you only can do it with hiting space many times
|
|
|
|
|
Immunity18 wrote: how i put my code in the site like quote ? (so it can take the tabs that has in Visual studio Eviroment)
check the "Ignore HTML tags in this message (good for code snippets)" checkbox before submitting code snippets.
|
|
|
|
|
/*
This is probably unrelated to your error, but you have a syntax
error in your code snippet. See below...
*/
void new_array(long p[] , int nCount , double *dp[][2])
{
double min , s;
find_values( p,nCount ,&min , &s);
for (int i = 0 ; i < nCount ; i++) {
*dp[i][1] = p[i];
if ( p[i] > min ) {
if ( p[i]*0.85 > min) {
*dp[i][2] = p[i]*0.85 ;
} else {
*dp[i][2] = p[i];
}
} else {
// ****************************************
// *** Your missing a parenthesis below ***
// ****************************************
if (p[i]*1.15 {
*dp[i][2] = p[i]*1.15;
} else {
*dp[i][2] = p[i];
}
}
}
}
|
|
|
|
|
It was html fault ( < min ) took it as a Html tag :/
i think my fault is on writing the name of array
|
|
|
|
|
bob16972 wrote: ****************************************
// *** Your missing a parenthesis below ***
// ****************************************
if (p[i]*1.15 {
Which is actually:
if (p[i]*1.15 <min) {
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi i would like to inform me anyone (or give me link) about data types
int float double long
like : int = 1,2,3,4,5 natural numbers
float = [0,1) ? 0.054353234243 0.9999999999999999 0.000000 but not 1 ?
double is ?
long is ?( bigger than int ? but still natural numbers?)
how i put them in printf("%", )? printf("%d %s " ,int , str) these 2 i know
ALso what about casting ? int x = (int) (while this is double)
i can combine a float + int to become a double ?
-- modified at 17:30 Saturday 19th May, 2007
|
|
|
|
|
Well int are not natural numbers: they are signed and bounded (i.e. there is a max int and a min int).
float are floating point numbers , i.e. you can think about them as real numbers, but, in fact they are somewhat different (being composed by sign , maintissa , exponent , they are bounded and have variable precision...
BTW what do you think about a good book on C language programming?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
dont know suggest me one . University gave meh 3 C & C++ language programming books but i think their build sux :/ i learnt more things via codeproject and google than from the book :P (well maybe i am a bit lazy to search 900 pages) but i do searching them and still dont find anything to understand the Data types
about int yes they can be negative too !:P
Deitel & Deitel C language programming is he one
|
|
|
|
|
Well,
Kernighan & Ritchie [^] is must.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Immunity18 wrote: University gave meh 3 C & C++ language programming books but i think their build sux :/ i learnt more things via codeproject and google than from the book (well maybe i am a bit lazy to search 900 pages) but i do searching them and still dont find anything to understand the Data types
Well, should such a topic have been included in the books? Just because a book does not contain exactly what you happen to be looking for at the moment does not necessarily make it the book's fault. It just may be that data types were not in the book's scope.
Immunity18 wrote: about int yes they can be negative too !:P
Which is why an int cannot be a natural number.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
also about long and double ? and how i put them inside strings ?
printf("%lf",double) ? i do this and it print me 0.00000 :/
|
|
|
|
|
Have a look at this [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
double thanks brb from amazon.com !
|
|
|
|