Cheers!
I solved it with this loop first.
while(getline(inout,line))
{
And inside the loop I used this!
Type: Posts; User: lovelace
Cheers!
I solved it with this loop first.
while(getline(inout,line))
{
And inside the loop I used this!
Hey!
I have been sitting with a problem for some time now, and cant figure out how it can be solved. I have some thoughts about it, and am gonna write that down after I posted the code.
...
Im not sure I understand what you mean?
Im trying to search for more then just ".", im scanning a line and I wanna scan for ,.!¤%&/ etc too, can I do that with one find?
Hello.
I have a simple question.
If I wanna search for . I use this way.
word.find('.')!= string::npos
Ah cheers, ill have a look at it later, thanks for taking your time for answering :) I didnt know what to expect, but now I got someplace to start :)
Hey.
I have been wondering about this for some time now, and when I couldnt get to a solution myself, I tried with google.
I know there is a function in string to check for the first character...
Edit: Deleted it.
Thanks for replying to my thread.
I were thinking about it today, why I called it "char stringtab[]" and used the name notation in my swap function. I tried with char **, string stringtab[], but...
char fullname[10][80];
for(k= 0; k < 10; k++) //(bublesort).
{
for(i=0; i < 10 -1; i++)
{
if(strncmp(fullname[i],fullname[i+1],20) > 0) // fullname[i] >...
Ok, I have now looked at it and tried to solve it, but I cant see the logic in it.
I changed the
soring_strings(char *stringtab[],int number)
And now when I try to call it, it says:
I see, I defined a char in my function, and that is why its only taking one char. My problem is, I can get it to work in main, there I defined a
char stringtab[10][80]
But I cant mange to...
if(strncmp(stringtab[i],stringtab[i+1],20) > 0)
{
swap_strings(stringtab[i],stringtab[i+1]);
}
Maybe its because im tired, but why aint it working?
yes I need strncmp! jezzzz!
strcpy copies a whole string.
I have like 5 names:
Hanne, Peter, etc...
I want them sorted.
Im not sure I understand what you mean?
Aint I using it right? It is working if I use it it...
I have been struggling with this Sorting Algoritm for very long now.
I got it to work with Ints, floats, but not strings?
It says
"Incompatible integer to pointer conversion passing 'char' to...
Ah yes that makes great sense. I should have figured that out myself, but thanks for clearing that out for me.
I added this and now it is working. Cheers!
...
After a few hours I thought I figured out how this fgets() worked. But now when I push ENTER it writes all strings in my array. Why is that?
I realised that fgetc put \n in the end, so i found a...
I have been working with this program for a long time now and I dont know how I can make it work.
The code is as follows:
#include <string.h>
#include <stdio.h>
int main ()
I apologize if this is too much description. But as Tater says, "Select the Mingw Compier", ill try to show you with these screenshots of my own program.
1. I assume you installed the...
Now when im done with my program, I would just like to say thanks for your help with the "Analyse, Plan, Write, Test" It made me struggle more and I got the solution by myself :)
Ill remember that...
Ah great!
I made a new char called A, and then printed A. Changed the spaces between the dates and now its working :)
char A = '*';
printf("%3c",A);
C-Programming is smart!
Ah yeh, im starting to learn how to set my up with the right spaces/tabs, so it looks nice and easy to read.
But im getting better and better at that though. But again, I just started programming...
Yep it feels good :)
Yeh I can imagine there is some formatting fixes, but I assume that comes. ;)
Now when you say "some formatting fixes" do you mean there is some mistakes/errors in the...
I ALMOST Solved it!
I took your advice, took my paper and a pen and started, it took me like 2 hour to figure out how I should do it.
I started with alot of different solutions and while I...
It wasnt my intention to get easy help. It were my intention to get a start and move on after that.
But I will try to use paper and pen and figure the problem out, and when I figured out how, I...