473,326 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Coming back from C to C++


I started out with C++ about 8 years ago, but in the last two years or
so I switched to doing a lot of C programming, so I've been out of the
loop for a while.

Anyway I've a few quick questions to ask:

Currently what's the biggest integer type in C++? Does C++ have all
the <stdint.htypes such as uint_fast64_t? I use these types a lot.
Back when I did C++ programming a few years ago, I don't think all C++
implementations were guaranteed to have <stdint.h>. Have things
changed? Also, does C++ have the "long long" integer type that's
guaranteed to be at least 64-Bit?

At the moment I'm working on a multi-threaded networking application
that will have about three threads. One thread will be updating the
screen (which will just be a console program displaying text), one
thread will be sniffing for packets, and another thread will be
sending packets.

I've heard something along the lines of "boost" threads being adopted
into the C++ standard, is this true? What's the most portable multi-
threading library for C++ (I'd like my program to be able to run on as
many kinds of machine as possible).

Another thing: Can anyone suggest what's the most portable networking
library for sending and receiving raw Ethernet frame? In the world of
C, "Berkeley Sockets" seems to be the main one. What about C++, what's
the best networking library to use if you're looking to maximise
portability? (Remember that I need to be able to send and receive full
Ethernet frames).

And one last thing: My program won't have a fancy GUI, it'll just be a
console application. I realise that neither the C nor C++ standard
libraries provide fancy facilities for setting the text colour, but
I'm wondering is there a portable library out there for doing this? I
recall using "conio.h" a few years ago but I don't know if this is the
"de facto" standard.
Oct 30 '08 #1
3 2396
On Oct 30, 8:08*am, Tomás Ó hÉilidhe <t...@lavabit.comwrote:
Another thing: Can anyone suggest what's the most portable networking
library for sending and receiving raw Ethernet frame? In the world of
C, "Berkeley Sockets" seems to be the main one. What about C++, what's
the best networking library to use if you're looking to maximise
portability? (Remember that I need to be able to send and receive full
Ethernet frames).
Berkeley Sockets.

And one last thing: My program won't have a fancy GUI, it'll just be a
console application. I realise that neither the C nor C++ standard
libraries provide fancy facilities for setting the text colour, but
I'm wondering is there a portable library out there for doing this? I
recall using "conio.h" a few years ago but I don't know if this is the
"de facto" standard.
For what platform? "conio.h" is a DOS-ism. In the Unix world,
ncurses (<curses.h>)
is more popular and portable. It all depends. Ask in a group
dedicated to your
platform.
Oct 30 '08 #2
On Oct 30, 4:08*pm, Tomás Ó hÉilidhe <t...@lavabit.comwrote:
>
I've heard something along the lines of "boost" threads being adopted
into the C++ standard, is this true? What's the most portable multi-
threading library for C++ (I'd like my program to be able to run on as
many kinds of machine as possible).
More or less. The current thread support in the draft standard is
inspired on boost.thread but it not the same. About portability, boost
thread works on many Windows variant and on most platforms that
support pthreads. Otherwise you could just program on top of pthreads.
Pthread implementations for windows do exist.
Another thing: Can anyone suggest what's the most portable networking
library for sending and receiving raw Ethernet frame? In the world of
C, "Berkeley Sockets" seems to be the main one. What about C++, what's
the best networking library to use if you're looking to maximise
portability? (Remember that I need to be able to send and receive full
Ethernet frames).
Boost.Asio, which is based on Berkeley Sockets, simplifies synchronous
or asychronous network programming. I'm fairly sure it support raw
sockets. Failing that you can also try ACE or straight Berkeley
Sockets.

--
Giovanni P. Deretta
Oct 30 '08 #3
On Oct 30, 4:08*pm, Tomás Ó hÉilidhe <t...@lavabit.comwrote:
Currently what's the biggest integer type in C++? Does C++ have all
the <stdint.htypes such as uint_fast64_t? I use these types a lot.
Back when I did C++ programming a few years ago, I don't think all C++
implementations were guaranteed to have <stdint.h>. Have things
changed? Also, does C++ have the "long long" integer type that's
guaranteed to be at least 64-Bit?
Not yet, and not yet. Both should be added in c++09, which will be (as
you can tell) next year.
Another thing: Can anyone suggest what's the most portable networking
library for sending and receiving raw Ethernet frame? In the world of
C, "Berkeley Sockets" seems to be the main one. What about C++, what's
the best networking library to use if you're looking to maximise
portability? (Remember that I need to be able to send and receive full
Ethernet frames).
Berkeley sockets or pcap-derived things. I think berkeley sockets are
the more portable one.
And one last thing: My program won't have a fancy GUI, it'll just be a
console application. I realise that neither the C nor C++ standard
libraries provide fancy facilities for setting the text colour, but
I'm wondering is there a portable library out there for doing this? I
recall using "conio.h" a few years ago but I don't know if this is the
"de facto" standard.
That depends on the kind of console somebody has. You could use a
library like ncurses to wrap that for you or you can do it yourself.
Nov 1 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: VbUser25 | last post by:
hi, whats happening is i do a form post from a form "A", to a form "B" where it does some processing and then does a form.redirect to form "C"..where there is a link to the form "A". I only want...
18
by: spiffo | last post by:
The Main Issue in a nutshell I am a corporate developer, working for a single company. Got a new project coming up and wondering if I should stay with Python for this new, fairly large project,...
3
by: Isi Robayna | last post by:
Hello, I am trying to communicate with a legacy socket server. The first thing this legacy server does upon getting a client connection is to send an ID back to the client... I am trying to read...
15
by: Drebin | last post by:
I am retrofitting a central login application and want to be able to read the Request.ServerVariables so that when they have logged on, I can send them back to wherever they were trying to go.. ...
2
by: Microsoft News | last post by:
What I have is a message box that pops up. It is another browser window. The code is a general function that you pass message, title and a key to. The box works great except, that if you are on a...
6
by: Sacha Korell | last post by:
My customer wants a user to be logged out of the system when he uses the same browser to navigate to a different website (without explicitly logging out). In other words, if the user navigates to...
26
by: gswork | last post by:
i hadn't designed a web page from the ground up for about 9 years, then i was asked to do one. I'd dabbled with html and vaigly kept up with some of the developments but other than that i've been...
5
by: Just call me James | last post by:
Hi, Coming away from the luxury of the delphi IDE has been something of a shock. As a consequence I've become aware that maybe I need to spend some money on a python IDE. As a beginner I...
2
by: Noggon | last post by:
My function, called first() keeps coming back to me in the javascript console as being undefined. Yet I can't think why it isn't loaded. Maybe I'm brain dead, so could use some help! :-) What...
2
by: BerkshireGuy | last post by:
I have the following code - but the calculation is coming out to be 0 rather than the percentage. Any ideas? Thanks Function GetAdoptionRate() As Integer Dim db As DAO.Database Dim rs As...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.