|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
| Sponsored Links |
|
|
|
|||||
|
Include <cstring> and take a look at the high-level functions there.
Code:
string s1, s2; // Empty strings
string s3 = "Yo dude"; // Initialized
string s4("I am cool"); // Also initialized
s2 = "C++ sucks"; // Assigning to a string
s1 = s3 + " " + s4; // Combining strings
s1 += "8"; // Appending to a string
![]()
__________________
|
|
|||||
|
Quote:
About the last questin, what do you suggest? Visual C++ or C++? Thanks A TON ![]() |
|
|||||
|
About char().... In C++ that's just a cast from an integer to char (32bit and 8bit), which can be done like this:
Code:
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char * argv[])
{
int ASCII = 65;
// int ASCII = 0x41; // In hexadecimal, if you need it
char c1 = static_cast<char>( ASCII ); // Declare c1 as char, and perform cast
cout << c1 << endl; // Display character (Uppercase A)
system("PAUSE");
return (EXIT_SUCCESS);
}
__________________
|
|
|||||
|
GOD **** IT
I need study these **** libraries first That is GREAT Bro, I REALLY APPRECIATE YOUR HELP About the C++ or VC++ that was what I was thinking of. So U suggest me C++? I dont have that but can I use the VC++ 6 ConsoleApplication method instead? Will it be easier for me to get from C++ coding to VC++ creating forms and linking their objects to the code or am I wrong? I really need some suggestions, yesterday I started this and Im NOT going to give up. THANX AGAIN marwex89, U R MY BRO ![]() |
|
|||||
|
No problem
VC++ and C++ is just the same... It doesn't really matter to most people, I guess it would take you about a week to get into VC++ IDE (wild guess) and their linking and form creating. There is no form creating in C++ (Dev-C++, NetBeans etc), so unless you want to hard code your forms, I suggest you at least try Visual Studio to see if that's OK. Warning: Pro edition = $$$, use Express ![]() Using VC++ console app: That's a template, with compiler and linking options set etc. All common C++ IDEs have those. Any more I could help you with while we're at it? ![]() EDIT: BTW, you have VisualStudio 6??? Use it. Period ![]() See a comparison on web between C++ in VS6 and newer. If nothing you absolutely MUST have, use VS6, I guess.
__________________
Last edited by marwex89; 07-21-2008 at 09:20 PM. |
|
|||
|
Len() has several equivalents in C++.
1) For structures and primitives like int, etc., use sizeof(). 2) For strings, use strlen() for primitive strings, i.e. char arrays. (include string.h) 3) I don't know how to get the length of a string string. 4) For dynamically allocated memory, use _msize() (include memory.h or malloc.h) |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Contest: C# vs. Java vs. Visual Basic | Jordan | General Programming | 265 | 11-27-2008 08:26 PM |
| Creating a Class in Visual Studios.Net (Visual Basic Section) | dream | Visual Basic Programming | 11 | 05-12-2008 03:47 PM |
| Visual Studio 2005 and Windows Vista | Jordan | General Programming | 3 | 01-22-2007 04:21 PM |
| Graphical programming add-in for Visual Basic 6.0 | xXHalfSliceXx | Visual Basic Programming | 10 | 01-03-2007 08:14 AM |
| Parallel Port Programming Using Visual Basic | kevintcp85 | Visual Basic Programming | 12 | 12-06-2006 01:09 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 100%