Hi, I'm messing with strings today (mostly for learning purposes). I have a text file that I'm going to read from; each row has three numbers:
1) year
2) month (as an integer)
3) numeric value...
Type: Posts; User: Roger
Hi, I'm messing with strings today (mostly for learning purposes). I have a text file that I'm going to read from; each row has three numbers:
1) year
2) month (as an integer)
3) numeric value...
There is something I don't understand about casting. This works if I put a double in the place of (float)n.
#include <math.h>
...
int n = 10;
....
printf("%f\n", sqrt((float)n));
Kenedy/Cyberfish,
I think I am going to try building a Linux server with an old computer over the break; I reformatted the drive recently with Umbuto. Regarding certificates, I was starting to get...
Hello, I'm looking for some advice on how to get established as a programmer, (I am particularly interested in developing interactive, database-driven web sites).
I am a computer-science student...
Great! Thanks anon, that makes perfect sense too.
Hello,
I need to understand the basic syntax of C++ and object oriented design including inheritance. So I'm trying to compile a sort of template to aid my understanding. This code has multiple...
Thank you Dae!
Now, I have a follow up question if anyone can help...
I would like to write a 'global function' that is *outside* of the class. This function should be able to work with two...
Hi all.
This is my first attempt a OO in C++. I'm sure there are some obvious mistakes. I know there must be more than one way to do this, but I would like to follow a partial example I was...
Thank you very much for your help laserlight. :)
char name[50];
float amount;
...
sscanf(buffer, "%s $%f", name, amount);
warning: format â%fâ expects type âfloat *â, but argument 4 has type âdoubleâ
I have a string saved in memory with exactly one space in the middle and two substrings; the string is formatted like this:
"Mike $120.00"
The first word will be saved as a string, the second...
I recently downloaded GoToMeeting . I am thinking of using it to help me learn computers faster. I recently went back to school and am frustrated with my own ability to learn at times.
I don't...
MK27, It's required study for class. But so is TCP, so a hello world example for tcp is good too. I'll look at Linux manual in the mean time.
I'm trying to learn about udp and most of the examples I am looking at are a little complex. Can someone please show a link or paste some code for a 'hello world' sort of server-side-UDP script?
I'm having problems with these two lines of code and incompatible types. The code worked, but compiles with this warning:
"warning: pointer targets in passing argument 6 of ârecvfromâ differ in...
I'm still new to C and am having trouble running a compiled program.
In the past when I compile on Linux I never specified a name of the file, so I would run the program with this command line...
oh geeze, I was fopen ing with "r"!
Thanks zacks7
This is my first attempt at using fread() and fwrite(). I am successfully reading one character at a time and trying to replace/write one character at a time to the same file. I can see by the printf...
I have an char array (a string) that looks like this yadayada235
I am looking for an easy way to get the int that is at the end of the string.
char *s = "yadayada235";
int n =...
I appreciate your help, but it's not supposed to be circular,,, the reason for the "tail" and "previous" is to run backwards through the list starting at the tail; i.e., the list can be printed...
Quzah,
I don't understand why this works (which I put in just for testing):
printf("%d\n", strcmp(new->name, head->name));
and this very next line prints a "sementation fault" error:
if...
....edit
nadroj, head is NOT null ("John" and "Paul" is printed in my example), but I still get a segmentation fault on the next line.
I'm getting a segmentation fault on the last line noted below. I'm comparing two strings.
struct node {
char name[25];
char address[65];
float amount;
struct node * next;
};...
I am getting this following error for the code at the bottom of this post:
"error: incompatible types in assignment"
The error is referring to these two lines of code:
curr->product =...